Hospitals will pay their own money for residencies in specialties that are wildly profitable. Usually, some fancy types of surgeons. Primary care, endocrinology, rheumatology, and a lot of other needed specialists are not so the limited slots are whatever the government will pay for.