Nonsense. The AMA doesn't limit the number of residency slots. Did you even read through the website I linked above?
Can you imagine if that website were for programmers?
"Waaaah we need more Staff Engineers at OpenAI but we just can't afford training them due to Congress not doling out enough for it, boo hoo".
State medical boards are the entities which ultimately decide on physician licensing criteria.