Yes, this is something people miss about prison. Many criminals are forced to repeat crime because prison is designed to economically ruin people. It's also designed to emotionally, physically, and mentally ruin people.

Point blank, the system is not meant to prevent or discourage crime, it's meant to enact torture for people we feel deserve it. Whether that helps our society does not matter at all - nobody cares if a rapist leaves prison just to rape again, so long as they are sufficiently punished for it. The punishment is more important than real, tangible outcomes, because ultimately we've built it so the punishment is what makes us feel good and safe.