A doctor can't put their patients in suspended animation while they get some shut-eye. The patient's condition may worse or improve. They may make vague complaints that are clues that can only be pieced together if you were around to pick up all of them.
Likewise, it's very very difficult for a doctor to serialize every bit of data they've gleaned from a patient to pass on to the next doctor to come on rotation.
Because of that "continuity of care"—having one doctor around to continuously interact with the same patient—is really important. It would definitely be great for doctors to work shorter hours, but it does have some real costs. Patients aren't text files.