I think it is because the government finds it valuable to have a well trained workforce to take care of its Medicare patients. Do you want physicians to pay for the opportunity to work for hospitals taking care of their patients?
At the same time, it does seem like medical internship conditions and pay are ridiculously terrible, underpaid, way overworked.
On second thought maybe it would make sense to only subsidize the residency programs that are financially unsustainable but necessary, like family medicine or non-subspecialty internal medicine. Downside to this could be that hospitals could choose to not have residents and exacerbate the physician shortage.
looks at the two grant proposals I'm on right now arguing for exactly that