But countless studies have shown that it's not an effective deterrent.
To be quite clear, I don't believe that prison's sole value is a deterrent. I think there's an element of justice (criminals should have to pay for their crimes), an element of deterrence (prison should make criminals think twice--this feels intertwined with 'justice' and yet distinct), an element of rehabilitation (to the extent that we can rehabilitate prisoners, we should), but mostly I think there is significant social value in protecting innocent people by keeping harmful people away from innocent people.
Even if the deterrent effect is nil and even if you don't believe in justice (or for many of my fellow liberals, you reserve 'justice' for crimes that offend you, such as white collar crimes), I would still keep prisons around for the protection of the innocent. That said, I have an optimistic view on the potential for prisons.
I can imagine a prison system with a redemptive quality where prisoners feel they’ve labored to redeem themselves to society (this requires society to esteem them accordingly to some degree) and learned a valuable trade in the process.
I think liberals (myself included) would do better to cast that vision for prison reform, rather than the current messaging which IMO comes across as hyperbolic (e.g., “literal slavery”) and naive (prison should be a comfortable place and the rest will work itself out).