If they didn't make a profit, they would fold and file for bankruptcy.
The thing about a state prison is that as it loses money, it will keep running no matter how much money it loses because of the Unions and graft. Paying the prison staff is way more important than looking after the prisoners, because without those jobs, all those tax paying citizens would turn into criminals or vagrants and more prisons would have to be built.
Surely the trick here is to teach the state run prisons how to make money?
But even as the private prisons make money the state still loses money, because they are paying money to the private prisons to look after the prisoners with no opportunity of profiting themselves. Spending less to look after the same number of prisoners on paper looks like a profit for only so long until it just looks normal, and you wonder why you're giving them money.
What really seems to be at issue here is probably infrastructure.
The states in question (al of them.) cannot afford to build new prisons, but they can afford to pay for private businesses to rehabilitate convicts for them... It does seem odd I know, but prisons probably have a shorter life expectancy compared to other buildings of a comparable size.
If you gave every prisoner a networked Xbox and an inexhaustible supply of soda pop, you wouldn't need locks on the doors... But that's just my opinion.