Media playback is not supported on this device
The wing, 34, scored in the last move of Wales' 24-18 defeat by Australia in Cardiff and was later in tears during a televised interview.
Gatland said that the last-gasp try "was fantastic for him [Williams]".
The New Zealander also says Wales' fans can look forward with excitement to the 2012 Six Nations and beyond.
"You've got to be excited about the Six Nations. I thought it was a really good game of rugby," said Gatland.
"And I thought we played some great rugby in that first half against one of the best defences in world rugby.
Media playback is not supported on this device
"They had the best defence at the World Cup - they were hard to break down.
"We scored a couple of cracking tries and you've got to be excited about the youth in this team.
"Jamie Roberts, now that Shane Williams is gone, is the oldest in that backline at 25 years of age.
"There's a good young loose-forward trio, some second-rows are still very young so we've got to be really excited about not just the up-coming Six Nations, but the next cycle and looking forward to building up to 2015."
Gatland felt that Leigh Halfpenny's 50th-minute sin-binning was "unlucky" and that Australia fully exploited Wales' disadvantage while the full-back was absent.
"I felt sorry for Leigh because with the angle he came from and the way the ball bounced he thought it had gone in to [Australia fly-half James] O'Connor's hands and he has not been able to see the ball, but he thought he had the ball at the time," Gatland said.
"The referee has a different angle and we accept that decision, but unfortunately we conceded 21 points in that period and that's the game.
"We got ourselves back into the game, but that 10 minutes has been very costly for us."
However, Gatland felt Osprey Williams can look back on a memorable send-off to an outstanding career.
He [Shane Williams] is a once-in-a-generation player
Gatland said: "The game didn't go fantastic for him outside of that [try], but it was a fitting end for someone who's had a fantastic career.
"He's won a lot of games from his individual exploits for Wales over the years so to score in the final minute of his final game was a fitting end, I think."
Australia coach Robbie Deans also paid tribute to Williams.
"He is a once-in-a-generation player," said former All Black Deans, echoing the thoughts of rugby figures such as Barry John, Graham Henry and Bryan Habana.
"What he has achieved in the game no one does really. He deserves every acknowledgement going.
"It was a nice way to finish, although I probably wasn't excited at the time until I saw who it was.
"He is a quality player and we wish him well. He has contributed to the game of rugby.
"He leaves a legacy a lot of players in Welsh rugby will want to follow. It's good for the game."
Media playback is not supported on this device
Wales coach Warren Gatland hailed Shane Williams' late try in their defeat by Australia as a fitting end to the player's career.