Is the point of prisons to restrict freedom as punishment for crimes committed? Should prisons be rehabilitative? Are prisoners supposed to emerge from the experience deterred from committing future crimes and morphed into law-abiding citizens?
Yes: the purpose of prison is punishment
Prison should be a punishing and unpleasant experience so that law-abiding citizens can feel safe
Prison should be a deterrent for crime
Nipping crime in the bud is the ultimate goal of the criminal justice system and deterrence is a key part of that.