I agree with Charles. Rehabilitation should be the goal for those that will be released into society. Communication with the outside world, social interaction. Education, and health are things that should not be taken away from people that will one day be a pet of civilization again, and I think the American prison system is just not set up to do support any of if. But yes, some people need to go to prison. And the ones that should not be released back into society (murderers, rapists) should rot in prison.
Even in real Social Democratic countries like Norway, Sweden, Germany etc. they still have jails and prisons. But those systems are really set up to rehabilitate people, unlike our systems that are seeming set up to make people into even better criminals and to dehumanize them. Reference: https://www.vera.org/spotlights/reimagining-prison-in-germany-and-norway