Hospitals do not do their accounting in a normal way. When you or your insurance gets a bill, the doctors are often listed separately. In other words, patients pay for them directly for services, they are not paid as employees of the hospital. That means for residents, someone's got to pay for them. They are not seen as lower cost labor because doctors are not accounted for as high cost labor. I'm not sure how it's done, but it's not the same as interns in engineering.