When we vacationed in Puerto Vallarta, we had to fill out a Mexican tourist/business visa form to be scanned by an OCR system, indicating where we were staying, how long we expected to stay, our passport numbers, and our names and home address.
Upon entry, our passport data was scanned, and the Mexican customs officer kept the top half of the form. Upon our departure, we had to return the bottom half of the form to be matched to the top half.
I have an extra copy of the form at home, I'll post it when I get there.
Children of foreigners are not issued birth certificates unless the parent(s) can produce evidence of a legal right to be in the country. Mexican police profile whenever they feel the need: no one cares if a gringo's feelings get hurt. Foreigners cannot own land within 35 miles of the Mexican coast. And on and on and on (here in the U.S., our own government is busy loaning illegals the money to buy land next to our coastline, if not simply handing it to them outright).
Their stance is this: what's ours is ours and what's yours is negotiable. The agitation they engage in here -- the whining, the demanding, the insistence on special treatment -- is done because, well, we fall for it! They consider us weak saps who deserve to be stripped of our country and belongings because we obviously don't have the will power to keep it. But they do, in their view. So they institute commonsense legal mechanisms to protect what's theirs, and go all out to get rid of the same mechanisms here. They view it as the strong taking from the weak, and in that culture, they see nothing wrong with that.