This comment is from That Guy on “Which is more expensive, prison or Princeton?”
Some services are more expensive than others because of the nature of the service or the nature of the demand for services. Incarcerating people who are dangerous to society will generally be more expensive than teaching people who are there voluntarily and can leave at any time.
If you required that students never leave campus for four years, shoot them if they try to escape, keep them under constant surveillance, and check their dorm room for contraband on a regular basis, outlawing all drugs and subjecting them all to random cavity searches, the college would be a lot more expensive.
I think a better comparison is between money spent on mental health institutions compared to prisons. Mental hospitals (or whatever the correct term is today) are probably half the cost per-person than prisons. When the mental hospitals shut down or can’t take any more patients, many of those patients wind up in prison instead. So, in some cases it’s pay a little now or pay much more later.
A mental hospital wouldn’t work for the prisoners who are violent and need to be contained. I watched Lockdown, a National Geographic series. In some episodes riots broke out and hundreds of prisoners started fighting. Also, many prisoners aren’t mentally ill but gang members and some in the mafia.
Good quality mental health support in childhood and into adulthood would probably save many from crime. Not everyone learns the best way to handle life and sadly pain n anger can easily set someone on a path to self-destruction and/or to harm others.