We are inheritors of the struggles and experiments Britain went through before and after we departed the Empire with how to deal with a large criminal sub-class. They tried execution by hanging on a fairly mass scale, indentured “transportation” to remote wild colonies, floggings, humiliation and sometimes death dealt out by the public in a pillory, caning with a birch rod. The list is almost endless. Finally, they and we landed on incarceration and “reform” as the humane method. Pity it doesn’t work any better than the “inhumane” methods. I will tell you this ... Saudi Arabia and Singapore use rods, nooses, beheading swords, and canes and both places are almost crime free.
There’s a price that comes with wanting to be the good guys. We have a legal system built around the idea that it’s better to let the guilty go free than imprison the innocent. If idealism was free of cost everybody would do it.
...and public shaming used to work well before getting into the criminal justice system.