Most services provided by the government operate inefficiently. Whether it is trash collection, property assessment, or prison operations, the private sector can do the same thing better and for less money. Privately run prisons operate efficiently enough to put some resources toward rehabilitation. Government run facilities do not adequately provide security or basic care.
There is no issue in general with for profit prisons, the problem comes in when states don't regulate them properly. In some ways, it is much cheaper to use private businesses to run prisons, as long as there is no financial interest in keeping people in prison longer. As long as the state regulates those things, it is fine for them to be for profit.
Detention facilities should not be for profit organizations. This has been shown to be inefficient, which is why the federal government will no longer outsource prisons. Outsourcing also leads to a loss of control. This has been shown to have adverse effects on the prisoners, including incentives to lock people up and human rights violations.
Detention facilities ostensibly provide a public service: keeping convicted criminals housed and fed and out of the general population. However, if a detention facility is a for-profit organization, the public service provided may be secondary to the financial bottom line. Expenses may be cut in order to bolster revenue, which could result in facilities providing substandard care. Worse, an incentive may even exist to incarcerate more people.