Controlling supply is the important piece, not being in a union. Once you limit the supply and limit your competition, you don't need a "union". They make up the leadership of the organizations that setup funding for the residency positions, which control how many doctors can be trained every year, effectively controlling the supply of doctors. No one, other than doctors, is incentivized to keep this supply constrained, which I assume is due to lobbying by doctors.
>Medicare-supported training slots are frozen where they existed almost two decades ago, perpetuating inequities in the geographic distribution of training slots and ignoring changes in the geography and demography of the U.S. population
https://www.ncbi.nlm.nih.gov/books/NBK248024/
https://www.aamc.org/advocacy/gme/71178/gme_gme0012.html
http://www.nrmp.org/board-of-directors/
https://en.wikipedia.org/wiki/National_Resident_Matching_Pro...