The market would have fixed this, or at least made it suck a lot less, if it weren't for a very strong regulatory capture, certificates of need for hospitals, regulatory bottlenecks to creating doctors, etc, etc.
Notice how the dental industry doesn't have nearly the same problems even if you control for the scope of the work they do.