The Hays Code, which governed what could and could not be depicted in Hollywood films, was enacted in 1934 and lasted until 1968.
One of the Code's biggest no-nos was glamorizing crime and the criminal lifestyle, on the assumption that people, especially impressionable youths, would seek to imitate in real life the behaviors they saw on the screen.
While these assumptions are universally ridiculed by the left today (was it any sillier than other moral panics surrounding new technologies, such as the left's contemporary hatred of AI, self-driving cars, SpaceX, crypto, etcetera?), the underlying logic was, at least, intuitive enough:
Man is a social animal, and people will spend a sizable fraction of their lives trying to win the approval of their peers in one way or another, be that dressing attractively or moving into a higher income bracket they can boast of to a date, or going to church on Sunday, or virtue signaling on the internet. So if those who they do in some respect admire - perhaps even fictional characters - are driving around town riddling their enemies with bullet holes, then it may cause their thought processes to conflate violence with the acquisition of social status.
Almost as if in exploration of this idea, there was an early Hollywood film (I don't recall the name of it) where the gangster antihero, condemned to die soon for his crimes, was asked by a priest to deliberately make a sad spectacle of himself as he was being dragged to the chair since he would be passing by a group of juvenile delinquents.
It was the priest's belief that whether these kids saw the gangster carry himself with dignity - even on an occasion so undignified as public execution - or like a coward would cement a lasting impression in their minds as to whether the hardened criminal's life was "cool" or not. And the gangster, who initially said he wouldn't, did exactly that when the time came, though it was left ambiguous whether he did this to dissuade his younger counterparts from walking the same path as him or whether he was genuinely terrified of death.
Anyway, my point is that if the "cool" criminal breeds copycats then the "uncool" criminal must do the opposite. Or in other words public humiliation is an often overlooked element of deterrence theory.
Merely lock a guy up for three years and his little brother or cousin will be like "yeah, losing your freedom must suck, but at least someone like that has street cred." But let's imagine that, for the next three years, they see him about once a week during their commute to school, picking up cigarette butts on the side of the interstate in an unflattering orange jumpsuit. Or riding on the back of a garbage truck while it's making its daily rounds through suburbia.
In a school setting, this would mean fewer suspensions and more having to wear a lunch lady-style (could be clearly male attire for males; that's beside the point) frumpy outfit while slapping lasagna onto lunch trays. I think it's fair to say that that bully will no longer sit perched at the comfortable top of the pecking order.
This would not, of course, deter people who commit crimes for the sake of the benefit or gratification of the act itself, but those who act up in the pursuit of status would find the whole exercise counterproductive. This would mainly target low-risk offenses, since giving serial killers ample opportunity to escape and/or interact with potential fresh victims doesn't exactly make for sound policy. But I think it matters because most offenders start out small before their crimes gradually escalate; this is a pipeline that, if interrupted early (for both the offender himself and anyone who would be influenced by him), will yield the best results for society.