I don't know how residencies could not be profitable for hospitals.If it helps, think about it this way,
how does the malpractice work?
There are a lot of indirect costs around residents. For example, staffing mandates. Think what implications there are to regulations that say, for instance, no more than 4 patients for each RN on duty. That said, there are a lot of indirect funding sources too. The problem is, of course, sometimes the funding doesn't equal the costs depending on where you are.
And now we come to the rub. Which of the MDs are willing to do their residences in places where everything matches up nicely to support a lot of residents? Keeping in mind that those places may not be Sarasota, or Tampa, or Charlotte, but rather places in Alaska, a small desert city in New Mexico, or some small place on the tundra of North Dakota.
If you're asking, does the US government give enough funding? You can get an answer that's "Yes" if you consider nothing else.
Does that funding cover every regulatory cost of having a provider on staff? Not likely, depending on the rules in the state you're in.
Does that funding get to where MDs want to practice? Rarely at all does that happen.