But he saved his best until last when the gold medal was already secure, being the only competitor to better 22 metres with his final effort.
Kovacs threw over 22 metres with the penultimate attempt of the competition but he was red-flagged.
Walsh told Radio Sport's Charlie Bristow that the gold medal made up for all the hard work.
"It feels pretty good mate. That's exactly what we came here to do, to win. To do that and to throw so well over the whole comp is something pretty special. It's payback for all the time and effort that the team behind me has put in, and also myself obviously. But without the team behind me, I couldn't have done it."
Amazingly Walsh competed despite a groin injury which meant he wasn't been able to train properly on the eve of the event.
"There's been a lot of treatment in the groin area the last few days," Walsh laughed. "I tweaked it a little bit during the last throw session before it. I was a little iffy how bad it was going to be but it's not that bad is it?".
Kovacs finished in silver with a best of 21.66m with Croatian Stipe Zunic (21.46m) taking bronze. Olympic champions Ryan Crouser was well below his best, finishing sixth with a best of 21.20m.
Fellow Kiwi Jacko Gill finished ninth with a best attempt of 20.82m.