- rehabilitation
- deterrence
- protecting society from the criminally inclined
Every society, including the most liberal, have found some type of prison to be necessary. It is not inherently barbaric, and it's the minimally barbaric option when dealing with a murdered for example. Public torture doesn't fulfill all three objectives, especially not the third, and is therefore a non-starter.
Note that this is distinct from claiming support for a specific instance of a prison in a specific country, which may well be barbaric.
This is decidedly not true in the US where prison is about retribution.
Those are the three valid purposes that prison should serve, whether or not that happens to be true for a specific instance of a prison system in a specific country.