For starters residencies are funded by medicare, not medicaid, via funding for Graduate Medical Education.
We have a stagnation of residencies relative to the US population growth, and in the near future I assume the medical student population growth. In essence, we need more medicare funding for residencies, but money is not coming in fast enough. Plus, under Obamacare there were many medicare subsidies that will expire soon that were specifically for residency funding, so those need to be renewed.