For example, sending a drug addict to prison for 10 years doesn't do anything to alleviate the harm of the crime, and in fact is harmful in and of itself, just in a different way.
The law needs to maintain a much closer balance between hurting people and helping people. While hurting criminals does have a deterrent factor, we do have to make sure that after we hurt them we build them back up so they don't reoffend. In the long run, skipping the "build them back up" step is more dangerous than skipping the punishment step. Our laws currently falsely assume that skipping the punishment step is the most dangerous thing to do.