A bit of history on how Medicare came to fund the residencies:
In the early to mid 1980s, back to the days when residents worked q2/q3 and 7 days a week, for 30 hours at a time, 108-110 hours a week, the predecessor to CMS, then known as HCFA (Health Care Financing Agency) made a determination that hospitals would be compensated on a diagnosis related group bases or DRG. The DRGs were theoretically established such that hospitals would receive a fixed prospective fee based on diagnosis codes. If the patient cost the hospital less to treat, the hospital won. If not, the government won.
This prospective payment system was implemented in 1984 and soon the University hospitals screamed that they were "teaching" hospitals, and residents cost them money and as government contractors, they were entitled to be "compensated" for the costs they incurred, over and above the PPS/DRG.
So HCFA decided that teaching hospitals were right, and soon the government feeding trough was filled to overflowing. Government cost accounting pays for a.) Direct costs of employment (wages, benefits, insurance, etc), b.) general indirect costs (office space, equipment, pencils, supervision, etc) which are the "overhead percentage" times the direct costs, c.) general administrative costs (costs of marketing, executives, etc) which are the "G&A percentage * everything below it".
By the late 1980s this became a very tidy profit center for the teaching hospitals, and since initially, there was no cap to the number of residents an institution could bring on, residencies grew and hospitals prospered. Finally, HCFA eventually figured out they had been had, but by then it was too late. A cap on "funded" residency slots was instituted in the late 1990s (I think). The institutions howled, but not much.
Then came the lengthening of residencies. A noted chair of a prestigious department of a Tier I research university who is now an executive leader in a specialty association started a drive to extend residencies at his university and managed to succeed in several residency programs, thus increasing the funding. I remember him saying, "if we can extend the residency program by a year, calling it a "research" year, we can easily get HCFA to increase the funding and we get a free year of research work out of the residents that we don't have to tap grants for." Which is exactly what happened.
Now, the government is finally figuring it out. The teaching institutions will howl louder, but it is a change that does need to happen. Residency training has for too long, been abused by institutions as a source of free/cheap labor.
Unfortunately, the government is taking over post-GME practice and coming soon to a clinic near you, will be vast changes as Obama-care exerts its influence. It is ironic that Law2Doc points out the economic fallacy of indentured servitude in the residency side of the equation, and now the United States proposes to have physicians enter into indentured servitude for the first time, I think since the Kansas-Nebraska Act and the Dred Scott Decision. It is doubly ironic that our potential enslavement is led by a man of our president's personal background and culture.