I think (without much data here) that medical training pushes insufficient sleep on doctors due to on-call schedules. While hospitals have doctors, many of their specialists come from private practice or multi-specialty clinics, which rotate being on-call between then (often in 12 hour shifts). The other cause of insufficient sleep is that if a patient under care of doctor has complications, they will often be called, even if just for a consult.
Economically, this is likely efficient compared to having hospital specialists (which may end up with nothing to do many nights), but causes docs to train for worst case scenarios sleep-wise.
I'd hope someone doing something as high risk and important as surgery would be getting as much as they need regardless of how much that is.
Exceptions are specializations that are essentially emergency/urgent but even most of them are on rotations like another poster mentioned where they've shifted their own sleep patterns to match their hours.
Since watching my friends become doctors (psychiatrists, uroligists, neurointerventional readiology) and my wife become a surgeon I have started telling friends and family "If your doctor looks under the age of 35 then you should ask them the last time they slept before they start treating you.
tl;dr : hospitals straight up own the futures of their med students/residents/fellows .. so they overwork them while paying them $40-55k year, and when they aren't working they have to study for their exams.