Private companies running the prisons make money from getting people put in prison and that they pay kick-backs to cops, judges, and law-makers to make sure that as many people get put in prison as possible. That is the real crime here. The government pays the company that runs the prison on a per prisoner basis. Really old prisoners are more expensive because of medical issues. Their medical bills are too high for the company to make a profit from keeping them so they tend to let them go because they can no longer profit from keeping them.
Sources:
http://www.huffingtonpost.com/tag/corrections-corporation-of-america-profits