Mexico, for all it’s faults, did us a big favor in extending asylum to the refugees. It makes it very difficult for the refugees to claim asylum status in the US when granted in Mexico.
Don't kid yourself. Mexico is not that altruistic.
When advised they could get tons of UN money to take the migrants, the offer was too good to refuse.