You're confusing the religion of many Mexicans with the politics of the government. The favorite pastime in Mexico since Independence has been the sport of gelding the Church.
The law was promoted by Coahuila's Institutional Revolutionary Party, which rules the state.
Look what happened back in 1926 when the Catholics decided they wouldn't take it anymore: The Cristero War.
Something like 90,000 people from both sides died. The country is Catholic. The government is not.
They country has a rapidly growing Mormon population, they are not that Catholic anymore.
The anti-religious laws of Mexico were not only anti-Catholic, but provided a ban on all proselytization by foreigners. This was aimed mainly at Protestant missionaries from the US, but would also prevent Roman Catholic priests from other countries from coming to Mexico.
Latin Americans are not all Roman Catholic. In many countries, Pentecostal denominations are very active, and often they are more lively and growing faster than the Roman Catholics.
I have not seen a survey of religious practice among Hispanic immigrants to the US, but I suspect that the "no religion" category is very high. In Mexico the rural priests were largely eliminated in the wars of the 1920s, so later generations grew up with little religious influence. What religion they have tends to be rather primitive and superstitious, and has definite traces of pre-Columbian practice.