Its a two fold problem. You can't exactly ask these hospitals to turn away people in need of healthcare, if you did it would violate the Hippocratic oath
Why do you think illegals are heading here?
What economic conditions could have led to a swath of former agriculture workers adventure through a horrific journey, not just from Mexico but from all of Latin America to come to the United States?
Poor, hungry, no jobs, violence, lack of economic oppurtunity?
Where did those stem from?
Terrible political leader ship? Terrible economic policies?
Familiar with NAFTA? CAFTA?
Both of those legislations eliminated the agricultural sector of majority of Latin American countries and Mexico. That begun a migrant push to the US. Couple that with the drug violence (thanks to the unemployment created by NAFTA) that took off that exacerbated the migrant issue.
Couple that with capitalistic exploitation of the illegal status of immigrants. You have this problem
If you want to solve illegal immigration:
1. Scrap NAFTA
2. Pass laws that would force companies to pay illegal migrants the same pay as an American worker with punitive fines for hiring illegals to begin with
3. Cease the "War on Drugs" to neutralize much of the effectiveness of drug cartels