That raises a great question. If it is not OK to ask if the student is a legal resident of the country or not, why is it OK to ask if there is a legal resident of that school district or not? Seems that they should not be allowed to ask if the student and family are residents of the school district. Fair is fair.
Here in NJ, education is funded locally - so when students are caught in our schools from another district they are sued for “tuition”. I guess the assumption is if they show a phone bill from the district, they are housed in a taxable property there (though that housing itself may be illegal).
I remember years ago there was a fire north of me (in Fort Lee, NJ - the west side of the George Washington Bridge). A few people died in the fire, and authorities were surprised how many people were living in makeshift units there. IIRC, there were four “rooms for rent” created in the basement, and people from four different countries were living in them. Certainly explains why there is never any parking in many areas, and why the only areas immune to this plague are those that don’t allow overnight parking on ANY street - a great defense against “thirdworldization” (though those wealthier areas often have higher taxes as well).
NYC charged a property owner after a fireman died fighting a fire under similar circumstances; he became lost because the building had been modified illegally (for illegal apartments), and was forced to jump from a few stories up to avoid being burned to death. The fall killed him, while others also forced to jump survived with injuries). These places are death traps, often with faulty wiring and inadequate escape routes (that was an issue in Fort Lee).