His teammate Jacko Gill also fell short of winning a medal, coming in seventh. The gold went to US shot putter Ryan Crouser for the third Olympics in a row.
Walsh said he had been managing an adductor injury for a couple of months but thought it had come right, however it went during the windup for his second throw.
"It's been an injury that has been there but has allowed me to train and has been getting gradually better and we did a great job to get me here in a healthy shape that would allow me to throw a long way... and then in the second round it just blew to bits.
"I've done it before and something we definitely have experience with and so I knew straight away that I was done for.
Walsh said he had to give himself a chance so decided to make a third (unsuccessful) throw.
"I didn't want to die wondering.
"That's sport right, the body doesn't always play ball."
Walsh's season is now over but he hasn't given up on another Olympics.
"I'll be back," he said.