At the time, Mexico was under the government of Lazaro Cardenas, who oversaw what might be broadly called a 'progressive' regime (that's probably an oversimplification and I can't tell you much abot this time period in general as far as Mexico goes. Most of what I know about it is through reading about the SCW) . He nationalized various industries, most notably the petroleum industry. He was also not particularly friendly to the Catholic Church (though he was not as vicious an opponent as his predecessor Plutarco Calles who waged an all-out war against catholicism in the 1920s).
You might recognize this broadly left-leaning, social democratic program as similar to that of the People's Front in Spain. In the Hispanosphere, few other countries were heading down a similar path. Most hewed far more closely to conservative traditionalism. And indeed, most supported the rebels in the Civil War. The Mexican government was even slandered as 'bolshevist' by a few Latin American conservatives. That the Spaniards had elected the People's Front to power seemed a sort of beacon of hope to the supporters of Cardenas' government in Mexico, especially because this was not just any other Hispanophone country, but la Madre Patria herself. If you wanted to be generous, you could say it was a noble expression of solidarity between two countries pursuing modernity, and if you wanted to be more cynical you could say it was an attempt to save one of the few ideological allies the current Mexican government had in the Hispanosphere.
In any case, Mexico ultimately proved the staunchest of the Republic's Allies. France only very sporadically allowed weaponry to pass through her borders to Spain, and Soviet aid, though eclipsing all else in sheer numbers, was intermittent and waxed and waned depending on the political needs of the Moscow government. Once the war ended, Mexico took in thousands upon thousands of Republican exiles (the Soviet Union took in very few, mostly top figures of the Spanish Communist Party). The Republic's government in exile was also based in Mexico City between 1940-46
Hope this helps.