Let's look at it this way. Suppose I have a crappy inner-city hospital serving a largely indigent patient population (Shreveport....cough...cough New Orleans...cough cough....) and I 've been getting along or not getting along without residents and one day I decide to start a residency program or two. How is this, in of itself, going to increase my operating expenses? Do I have to build new facilities? New parking? Will I have to expand the crappy cafeteria already serving 10,000 meals a day to account for a handful of residents (hell, we'll let 'em eat for free and call it a perq).
Other than a little office overhead for the program (secretaries, a Program Director who will have to sacrifice some of his money-making clinical duties) it will not cost nearly the amount per resident payed out by the government to teaching hospitals that see medicare patients (all of them). In fact, because the direct payment is much more than the resident's salary and benefits, the medicare money is an important source of revenue to a hospital that otherwise has a difficult time getting paid for any of its services.
As another thought experiment, imagine if every resident walked off the job at New Orleans Charity Hospital (which is being closed down I understand post-Katrina). The place would grind to a halt as over-worked and frazzled attendings threatened a walk-out if the hospital didn't hire some hospitalists or even PAs to do the work that their former residents did before they answered the siren call of higher wages at Home Depot.
Generating revenue is a nebulous concept in a hospital, especially one that does mostly charity work. I bet I do work that is billed for more than my salary and I also wager that I represent a real cost savings to my hospital which would otherwise have to hire a doctor or an extender at the market wage (which, at our hospital, is 50 bucks an hour or what they pay residents to cover "gaps" in the call schedule).
So when you say "The cost of training a resident exceeds the revenue that a resident generates" you are swallowing, hook, line, and sinker, what our bureaucratic masters are dangling in front of you.
This is not to say that on some rotations I am not entirely superfluous and useless and completely in the role of a student but these are minimal the higher you get as a resident and once you learn enough to operate independently.