If it is penitence and rehabilitation, this makes no sense.
If it simply to incarcerate people for a while to make their lives difficult and make them not want to reoffend, this makes the wardens’ and guards’ life more difficult.
I suppose if the objective is to demonstrate righteous wrath and judgement then this is a good idea. However such demonstration is not likely to make society safer.