per wiki: From the early 20th century to at least the mid-1980s, educational policies in Mexico focused on the “Hispanification” of indigenous communities, teaching only Spanish and discouraging the use of indigenous languages.[40] As a result, today there is no group of Nahuatl speakers having attained general literacy in Nahuatl;[41] while their literacy rate in Spanish also remains much lower than the national average
In the early 20th century, one common political idea to increase unity eas to decrease regional languages.
It looks to have been a slow, gradual practice, with Spanish as both semi-official and a lingua franca replacing local usage. This Wikipedia article may be of interest as regards the time scale involved.
Nonetheless, Native languages persist, and in greater quantity than in the U.S. Over 1.4 million speak Nahuatl (the Aztecs’ tongue) or a close relative, plus 400,000 each speaking one of the two larger dialect groups of Huastec, a more distant relative (and 200,000 speaking dialects in a third group); over 700,000, mostly in the Yucatan peninsula, speak a Mayan tongue (there is no “Mayan” language but a dialect cluster). About a half million speak Zapotec,
This was not a Mexican thing either but pretty much held to be a universal truth. The British suppressed the use of Gaelic and Irish in the Scottish Highlands and Ireland, and in the US, not only did governments (Federal and local State ones) in the US do the same thing with respect to Indian (indigenous) peoples and languages, they even suppressed the use of French among Louisiana Cajuns.
Also, as Polycarp mentioned, native languages are still quite well-represented. Unlike the US, where they are either dead or dying out.
The last estimate I heard for Guatemala was that about 40% of the population still spoke a native language, and I know from experience that many people there speak no Spanish or only rudimentary Spanish. So, efforts may vary from country to country to stamp out native languages, but throughout Latin American, they are still alive and if not well, at least hanging on.
This suggests another question: The Washington, D.C. area where I live has a very large number of immigrants from Mexico, El Salvador, and Guatemala, but whenever I hear any of them speaking among themselves they are speaking Spanish. Do the inhabitants of those countries who speak a non-Spanish language tend not to come to the U.S.? I can see where this might be the case if the non-Spanish speaking people in those countries live in remote areas of the country and the immigrants come mostly from more urban areas.
Worth noting that what applies to, say, Mexico City does not necessarily apply to all of Mexico; [Mayan languages](the Mayan languages - Wikipedia) are still spoken extensively throughout the Yucatan peninsula.
That’s part of it, but another factor is what I think of as “why are we speaking (foreigner) then?”
Someone from Latin America can assume that another Latin American will speak Spanish with a higher probability of being right than if they assume the other person speaks, say, Nahuatl. So they may address one another in Spanish being reasonably sure that it will work, whereas the same can’t be said of smaller languages.
I’ve seen this phenomenon work with speakers of Catalan who were outside of Catalonia (Mom recalls it in Catalonia c. 1958), with myself running into other Hispanics in English-language MMORPGs… I’ve experienced it in a hotel lift in NYC, where twelve people were asking “what floor?” and talking to each other in English, but when the lift stopped everybody cursed in Spanish… we stared, laughed, and of course switched languages.