The soldiers -- the last of seven initially charged -- were accused of killing eight of the suspected gang members in cold blood in a warehouse in the central municipality of Tlatlaya on June 30, 2014.
The army initially said the 22 suspects were killed in a shootout.
But a woman who survived said many of those killed, including her 15-year-old daughter, were executed by the soldiers after surrendering.
Four of the arrested soldiers had already been released last October for lack of evidence.
More From This Section
The seven soldiers, including a commanding officer, were also acquitted by a military court, though it sentenced the officer to a year in prison for disobeying orders to undertake nighttime operations only with his full squad of 30 troops.
The National Human Rights Commission had determined that between 12 and 15 of the gang suspects were executed.
The case has put a spotlight on the controversial use of the armed forces to combat drug cartels in Mexico.