Scotland went down 34-31 to lose the series 2-1 to the Pumas, with Emiliano Boffelli scoring the winning try in the last play of the match with the clock already past the 80-minute mark.
The tourists squandered a 15-point advantage in the final half hour as Argentina clawed their back into the match in Santiago del Estero.
The lead had been whittled down to 31-27 to the Scots by the time they were awarded a penalty inside the Argentine 22 on the 69th minute. Rather than going for the three points, Blair Kinghorn kicked to the corner but Jonny Gray was held up over the line from the subsequent lineout and the chance was gone.
Scotland had scored a try from a similar situation in the first half, as Townsend pointed out.
“We got 15 ahead by kicking towards the corner in the first half,” said the head coach.
“We backed ourselves and just didn’t get the ball over the try line. That was unfortunate but it was something we will learn as a group.”
Despite the result, Townsend felt it was Scotland’s best performance of the tour. Duhan van der Merwe and Ewan Ashman scored two tries each and Kinghorn, who had his best game as a Scotland stand-off, kicked 11 points. But Argentina showed impressive steel to fight their way back and scored four tries through Santiago Carreras, Nahuel Tetaz Chaparro, Gonzalo Bertranou and Boffelli. Boffelli, the Edinburgh winger, added another 14 points with the boot, including a penalty from his own half.
“We are obviously really disappointed because we were ahead for most of the game and we had chances – chances to score a try and were held up over the line, and chances just to be a bit more efficient with our exiting in the last five minutes,” Townsend told Sky Sports.
“I really feel for the players because so much of their display was full of courage and skill.
“It was our best display of the tour and would have been a famous win but the feelings just now are the opposite of that.
“The way we played away home in front of noisy crowd, against a very good side, I am so proud of that effort.
“We just need to make sure we win those games that we dominate for so long.”
Scotland and Argentina will meet again in the autumn, with the Pumas scheduled to play at BT Murrayfield on November 19 as part of their European tour.