In the US, med school also requires a significant financial investment (debt) and health investment (long hours). If it weren't for the reward of helping people, I don't think many would do it. I think med school should be more incentivized.
I'm not sure off the top of my head, but it depends on what exactly the specialization is. I'd imagine it's roughly around the salary of a software developer. However, education is a much larger investment, so a lot of that money is put towards loans.
Personally I was lucky and didn't have any debt graduating with a CS degree (actually an MS and BS), but if I were to do med school I would need to take out loans