Yes. But that is only possible because the justice system allows that.
I totally agree that these contracts should not be legal. But the argument is still correct overall, the prisons don't put people in prison.
And the US had overpopulated prisons before private prisons. In fact, the VERY REASON why private prisons were established was because there were so many prisoners that the government were just not efficient enough to organize it at that scale in some cases.
Fundamentally it is the bad laws and the bad legal system that leads to this.