The precedent would be a illegal needs an emergency procedure like an appendix that burst. USA hospitals, many funded with government money would perform the operation. The initiation of a immoral act of crossing the border does not necessarily forfeit the privilege of getting medical help. Strict libertarians call most wealth transfers theft, even if a fellow citizen. I would favor the life saving path. Prolonged treatment including drugs might be different but the loss is not as much as one might expect since the monies spent on treatment do get recycled back to health care workers and companies. There are illegals too that contribute to the USA, a net win in taxes. I would suggest the USA could look for ways to receive more of these people and less of the criminals and undesirables.
There are ways to recapture monies from illegals too. Tariffs on that nation's products, taxes on remittances and deductions from foreign aid packages would incentivize some nations to do more to limit their citizens from crossing the border.
To speed up legal immigration and require those visiting the USA I still like the bonding method. Should they fail to leave as expected the bond could become bounty for anyone that that turned in such an illegal. Today i saw an article of a Turkish man who said he paid 10,000 to a cartel for smuggling after he tried several times to enter the USA legally. I'll assume his intentions were to work, but at least the USA would get the 10,000 if he overstayed and the cartels nothing.
Some nations allow long tourist stays, perhaps even as much as two years. For those extensions, immigrants have to report in every so often and pay fees for each month. They also have to get a clearance to leave the country. Thus, if they did not pay fees they might be detained until they pay the fees, plus fines.
Biblically, I sure am glad that Mary and Joseph were able to leave their country when the baby males were being executed. Imagine if there is no where to go. This too needs reform to separate the bona fide asylum seekers with those just using the designation for a pretense to stay. Since immigration courts take a year to hear the cases, that is totally ridiculous and on us. Detain and make quick decisions would stop the incentive to come here illegally for many and allow the bona fide asylum seeks a safe haven. I hate to say it but there could come a time when USA citizens could be the refugees. The movie Day After Tomorrow though complete fiction depicts such a possibility. I guess overall the USA should work to be humane but take practical steps to eliminate illegal crossings or find ways to fund those crossings to eliminate some of the burden on US taxpayers.