Says who? Where are you getting this information from? Did you poll all doctors or something?
So do Chef's, and lots of other professions. Lots of people do them because they love them.
If every Dr. was a surgeon or radiologist, or cardiologist, etc. no one would get treatment. Unless of course you needed surgery, or something specific.
Do you have any idea how the process of becoming a doctor works?
You graduate medical school, you then interview at a multitude of residency programs. You rank them. Meanwhile, the programs rank those med school graduates that interviewed with them.
Now, are there family doctors who got straight A's in med school? Sure.
But which ever fields are in the highest demand, those don't take C students.
Those who make the best grades go to the best residences.
You can almost guarantee that your family doctor, and the ER doctors you see got much lower grades than the heart surgeon.