I was being a bit reductionist since it's really the interaction of multiple laws and policies, but largely they all boil down to money and licensing requirements for practicing medicine. Other responses to your parent comment explain it in a bit more detail, so you should take a look at those. The residency bottleneck is a real thing that I've had the mispleasure of hearing about from multiple friends and family members pursuing a medical degree.