I don't know the answer to the important question you asked. Normally I wouldn't think the feds should use our tax money this way. But the feds decreed this group of people will receive medical treatment, so it makes sense the feds should provide the funds to pay for the law which they enacted.
What bothers me more is that hospitals don't have to report these people who have broken our immigration laws. It doesn't make sense when you consider hospitals are required to report all sorts of people to the proper authorities. Why not illegal immigrants?
There have been attempts at legislation requiring hospitals to do some type of investigation as to legal status, but the hospitals have been against this, saying that it is not their job to enforce immigration laws.
This has been going on for years. In fact, Governer Bush was a vocal critic of federal policy.
In his 02-05 budgets, Bush requested funding for this, but Congress did not appropriate the money.