The issue isn't a shortage of residency slots, it's that we don't allow doctors with foreign residencies to practice in the United States.
The physicians in Spain and South Korea and Costa Rica are really good. Arguably better than American doctors based on health outcomes. Many would jump at the chance to earn high American wages. There's no reason a South Korean doctor with ten years of experience in the world leading hospitals of Seoul shouldn't be allowed to practice medicine in the US just because he didn't do a residency in rural Alabama