Because it's not. If you actually look at the numbers doctors only get about 1/3 of the money. Furthermore with the kind of money you have to loan it would make no financial sense to become a doctor.
Noone is having a good time with this system. Doctors want the insane amounts of work and stress coming from the lack of personnel that justify the salaries just so they can pay the student loans.