The estimated recovery time of the surgery is six weeks for Wainwright, who underwent Tommy John surgery in 2011.
"Unfortunately, I couldn't get over that bone bruise in there," the 36-year-old Wainwright told reporters.
"I just needed time, and I didn't have time. I took enough time off where we thought we could go back out and pitch for an extended amount of time, and you saw what happened. ... It was frustrating because I really wanted to help the team, and I really wanted to be here down the stretch when we were so close."
Wainwright posted a 12-5 mark with a 5.11 ERA for the Cardinals (83-79), who finished four games behind the Colorado Rockies for the second wild card in the National League.