Two orthogonal factors undermine your observation: (1) the prison system is drifting toward private, for-profit prisons, and rehabilitating offenders incarcerated therein would be damaging to the long-term profits of the institution, and (2) believe it or not, a significant number of inmates in the American system do not want to be rehabilitated, which is directly linked to various external factors.

It's easy for those outside America to put the United States Criminal Justice System in a vacuum -- it's happening all over this thread and it's honestly ridiculous -- and try to explain to Americans that strategy A doesn't work because recidivism B, and country C actually tries strategy D so America should implement strategy E, but the fact is that the American justice system reflects a lot of other problems in the United States that need to be addressed. Key among those is a significantly substandard education compared to other parts of the world, especially the oft-cited Scandinavian countries for the purposes of this discussion.

It is my personal experience that rehabilitation in an incarceration setting only works in the majority if the criminal has some kind of education and desire for a better life. Those citing Norway's prisons, have you ever considered that education is better in Norway and most folks don't break bad by default? Norway has the 7th best education in the world. The United States is much further down the list.

Even in minimum, the majority of the people I was in with did not especially mind being there nor look at it as a serious event. "Oh, I got arrested for check fraud again, can't wait to get out and go back to selling meth, much less risky income." To most people I talked to, it was an inconvenience and mild disruption from their life of crime. The hardest of the hard criminals want to be in prison because they can actually have power in several systems run from prison, including an entire infrastructure of gangs.

To be quite honest, I think pointing at American prisons and saying "your job is to rehabilitate" is a nice, ivory tower sort of feel-good explainer for sending people to prison, but the fact is going to prison in the United States is a complete life-ender for "doing good" in almost every case. My felony just fell off my record and even in this industry, I was nearly unemployable -- my conviction wasn't even computer-related, but most people pull a report and see "felony" and discard the entire candidate. Prison is only a portion of the consequences for committing a crime.

Regardless of how you might feel criminal justice should happen, right now in the United States the policy is one of deterrence. Your life is pretty great until you pick up a felony, then you'll spend the rest of your life trying to undo the damage. And, to be honest, I can understand the logic there: your government has an implicit contract with you that the liberties offered and protected by the United States are yours as long as you don't do any of these hundreds of crimes, and once you do, the contract is void. I can understand the thinking that brought us there. I also don't think the failure thereof is necessarily the fault of the system, as criminal rehabilitation absolutely cannot exist in a vacuum of policy. Life isn't SimCity. You can't tweak a "prison life quality" slider and magically fix recidivism. There are other external inputs into that equation and any discussion thereof must include the whole picture.