In my opinion, the biggest cause of this is the artificial caps on the number of doctors graduated every year. Only a small fraction of qualified med school applicants are accepted each year. (In my idealism) more doctors would create more of a free market. The market would find ways to identify high quality doctors who deserve $1m a year, but there would also be the $200k/yr doctors for normal middle class and $50k doctors for low income areas.
The cynic would say it's because the medical community is being protectionist. The conservative would say it's those pesky liberals worrying too much about our safety. The doctors I've worked with speculate it's because of the "priest" like status that doctors have historically held in society.
For hackers... well, let's just say there's a lot of money to be made in medical software. Doctors value their time very much and are willing to pay silly amounts of money for modest efficiency improvements. Most hackers are scared away from medical software because of concerns of excess regulation and complexity. That's a fair concern, but that doesn't mean there's still not good opportunities.