"I took the decision some time ago and it wasn't just because of the result but because I think a cycle has come to an end in the national team," said the 34-year-old centre-back who captained Argentina in Copa America 2007.
"International football takes a lot out of you, so I prefer to concentrate on playing for a club and hope that I can finish my career with another trophy."
Ayala has just signed a three-year-deal with Real Zaragoza after spending 7 years with Valencia.
"I want to keep playing and so will be looking after myself, training hard and watching what I eat."
Ayala is Argentina's most capped player with 115 caps. He ended his career on a low after scoring an own goal in Argentina's 3-0 defeat against Brazil last Sunday in the Copa America final clash.