The main cap on the supply of doctors is imposed by limited Medicare funding for residency programs. Members of Congress who control that funding aren't subject to the Hippocratic Oath.
Not all residency programs are funded by Medicare. And even among those that are funded by Medicare, many have additional slots that are unfunded but exist anyway because a resident provides cheap labor. If a physician decides to change specialties and do a second residency, these unfunded programs and slots are their only options because Medicare won't pay for second residencies.
It's not clear whether graduate medical education programs operate at a profit or loss. The accounting is complex, and the results depend on how revenues and expenses are allocated internally.
https://savegme.org/