First, in the mexican Constitution from 1917 it is established in the 3rd article that basic education must free (gratuita), not associated to religion (laica) and mandatory (obligatoria). This was conceived with spanish in mind (read further).
In 1921 the Secretaría de Educación Pública (Public Education Secretary or Government agency) was founded on command of president Alvaro Obregón, and it was coordinated by José Vasconcelos to promote education through the whole country.
After that there were many literacy campaigns (campañas de alfabetización) during the following years. Mostly between 1921-1944 You can read this article in spanish for a brief summary of what happened during those years).
The 21st of August of 1944 there was a law called "Ley de emergencia para iniciar la Campaña Nacional contra el Analfabetismo" (Emergency law for beginning a national campaign against illiteracy). It was promoted by president Manuel Ávila Camacho and supervised by secretary of education Jaime Torres Bodet.
So, during the first part of the 20th century it was a priority for the authorities. Not so much for promoting education per se, but for promoting a national identity after the Mexican Revolution (one of many nationalistic initiatives promoted by Vasconcelos and many other intellectuals, a tendency that began in the second half of the 19th century between the tensions among the hispanophiles and the mestizophiles regarding which would be the best approach to define the nation at the end of that century). So, spanish was a given as part of nationalistic homogeinity.
From 1940 to 1970 there was a period called the "Milagro Mexicano" or "Stabilizing development (desarrollo estabilizador). There was a strong promotion for modernizing the country, and culture and wellfare was part of that, although it began to be abandoned halfway through. For example, the Mexican Institute of Social Security (IMSS) was founded in 1943 and the National Autonomous University of Mexico (UNAM) was centralized and relocated south of Mexico City, inaugurated in 1952.
So, it was a period for development, although many communities were abandoned in favour of modernizing the most important cities and to industrialize the country. Although not as mainstream, there were more literacy initiatives throughout the second half of the 20th century, either by the government or by private institutions.
In 1992 there was, for example, the Acuerdo Nacional para la Modernización de la Educación Básica y Normal, which promoted the modernization of national education (and if I don't recall wrong also the level of mandatory education was upscaled a bit).
Anyway, its been a long and very corrupt process, with constant initiatives throughout the 20th century. Very questionable in the sense that it promoted a cultural standards the eliminated many multicultural differences in the country (ethnocide is what some call it). Even though spanish is not THE official language and there are more than 60 languages spoken in Mexico, basicly everything media and law related is and has been in spanish. So, even though the National Institute of Indigenous affairs (Instituto Nacional Indigenista) was created in 1948, in 2003 it was modified to become the Comisión Nacional para el Desarrollo de los Pueblos Indígenas (National Commission for the Development of Indigenous People). This was to promote literacy in other languages. After that, and reaaaaally slow, there have been some initiatives to translate laws and offer multilingual education as well as legal representation. So, there is still a lot to overcome. But education in other mexican languages is slowly on the rise.
EDIT: Sorry for all the grammar mistakes, I was on my cellphone travelling by Uber and couldn't review it. I'll try to modify them when I have a little bit of time.
And for anyone that doesn't understand the relation with literacy: there were many government policies that promoted spanish as THE mexican language, being education one of the most important contexts to promote that. If you were taught in a school in the 20th century it was only in spanish, without considering multiculturality. This has changed since the nineties, and during the 21st century there has been more education in other languages, as well as media, legal and political representation, as I said at the end of the reply.