"Don't ever underestimate the joy that you bring to everyone you meet. You represent something really quite special, you are special, and society will always recognise that," he said.
"That is an important part of your legacy … It's a community that focuses on supporting each other with kindness, respect and compassion, as well as reaching out to serve the wider community."
Speaking to the elderly veterans inside the hospital, the Duke of Sussex injected some humour into the otherwise sombre occasion.
"Both your founder King Charles II and Sir Christopher Wren himself would be delighted to know that the institution which opened its doors to the first Pensioners over 325 years ago continues to fulfil its original purpose of giving exceptional care to soldiers in retirement," Prince Harry said.
"They'd also be amused to hear about the late-night cricket in the hallways! Much less the serenading by Colin who I am told is Royal Variety standard, but let's assume they haven't seen your synchronised buggy drill quite yet.
"Now I stand here before you to not only acknowledge the incredible contribution you have made to this nation but to acknowledge that you, my friends, are also seriously good fun to be around."
The new dad attracted plenty of laughs during his visit, joking around with the elderly servicemen and women and asking them to pick their "favourite" hospital staff member.
Harry also got a laugh out of 90-year-old veteran Frank Swift who had just told the royal visitor that he "can't walk."
"But you've got a comfy chair!" Harry quipped back.
Meanwhile, his brother Prince William delivered the D-Day address made by his great-grandfather King George VI in 1944 during a commemoration service at the National Memorial Arboretum in Staffordshire.
"Four years ago our nation and empire stood alone against an overwhelming enemy, with our backs to the wall," he said.
"Now once more a supreme test has to be faced. This time the challenge is not to fight to survive but to fight to win the final victory for the good cause.
"At this historic moment surely not one of us is too busy, too young, or too old to play a part in a nationwide, perchance a worldwide vigil of prayer as the great crusade sets forth."
His wife Kate Middleton was conspicuously absent from the event, instead attending the Beating Retreat military pageant in Whitehall in London.
The Duchess of Cambridge took the salute, a role traditionally undertaken by the Queen or another member of the royal family.
She exuded simple elegance in a cream Catherine Walker coat during the army event, which has taken place every year since 1966 and raises money for service charities.