It's a bunch of factors -- many of which I have been trying to understand at a systemic level.

Here's what I know so far:

1. Are medical residents students or workers? This was actually an open question of law -- you can see a discussion of the issue in NEJM here[1].

2. Regardless of your answer to #1 (or, even if your answer is "both"), hospitals unambiguously treat residents as workers (labor). Quoting NEJM again, "residents are clearly indispensable to the care provided at the hospitals where they are employed, even if their work is reviewed by supervising physicians."

3. Having a position in a residency program is viewed as a privilege -- that is, getting a spot is competitive, subject to The Match[2]. Since it's very difficult to "match twice"; nearly impossible to transfer to a different residency; and quite a leap of faith to quit the profession altogether (throwing away 4+ years of med school and $200K of tuition payments); you end up with something that feels more akin to indentured servitude than a normal job.

4. Residents are very wary about the possibility of being booted from their program for incompetence. I think the risk of this is actually quite low -- after all, to make it through med school and The Match, you are probably quite the high-achieving type. And for a program to lose a resident is a major hassle, since they rely on them so much. But this fear is supported by a strong sense of Imposter Syndrome[3] running rampant in the early years -- an inevitability of the inherent difficulty and complexity of patient care. This leads to a culture of deference to superiors, who seem to have a lot more confidence (and thus, seemingly, competence) than you.

5. Various economic and cultural factors combine to contribute to the encouragement of long hours. Wikipedia has a good discussion here[4]. The tl;dr is that hospital systems are themselves resource-constrained; residents are cheap & guaranteed labor; residents are therefore "easy targets" to pick up slack for an otherwise over-extended system. Since medicine has historically had ridiculous hours for residents, the higher-up "attending physicians" believe it's essential to medical training (survivor bias, etc.) Further, residents save the attending physicians, themselves overworked, from some of the scutwork of medicine (e.g. especially data entry and paperwork). So, they have no incentive -- and, often, no power -- to fix things.

6. Residency spots at hospitals are funded by the government and limited by federal regulation. There are too few residents. Further, hospitals are under no obligation to make sure their program can run without resident labor. Therefore, hospitals behave as though residents are "free" labor.

7. Residencies last 4+ years, and then these young doctors move on to other programs, usually in other cities and states. This means there is built-in turnover, which means hospitals don't have a strong incentive to invest in their own staff -- at least, not this specific part of their staff.

8. Medicine, on the whole, has long hours and difficult on-call expectations. This for the simple reason that patients can become sick at anytime and doctors feel a moral obligation to put in the most amount of effort possible for their patients, even at the expense of their own health. I will say, though, this strikes me as one of the weakest factors driving long hours for medical residents. It is, however, often used as the justification for long hours ("we care about patients", "we can't let them down", etc.). In reality, I think the "medical factory system" exploits the built-in altruism most doctors feel toward their patients in order to squeeze more revenue from them. If hospitals really cared about patients this much, they would hire some secretaries to save their doctors valuable clinical time, rather than using their younger/cheaper doctors as secretaries for the older/expensive ones.

[1]: http://www.nejm.org/doi/full/10.1056/NEJMp1100414

[2]: https://en.wikipedia.org/wiki/National_Resident_Matching_Pro...

[3]: https://en.wikipedia.org/wiki/Impostor_syndrome

[4]: https://en.wikipedia.org/wiki/Medical_resident_work_hours#Ca...