They get paid 50-60k a year to work absolutely ridiculous hours. I had a surgical resident for a roommate. He'd get home and if he went from the door to the bed without showering or relaxing he might be able to catch 5 hours of sleep before he had to get up and be off for another shift. We'd buy protein bars so he could eat something on the run otherwise he'd never have anything to eat on a full 24 hour shift. That goes on for 5+ years after already having been in school for 8 years. And it's not like they're just sitting around all day watching real doctors work or something. And the average pay for a general surgeon as of 2017 is 350k (before malpractice insurance).
I got paid even less (around negative $40k) to spend every waking hour 4th year of college to complete coursework, do varsity athletics, search for a job, and do an honors thesis. But these were investments in human capital.
I'm not sure I understand your point. They have already gone through 8 years of school which they definitely didn't get for free. Surgical residents then work for 5 more years working 100+ hours a week.