If the goal of prison was "change behavior" rather than "make miserable", it might seem unfair ("bad people are getting away with it" etc.) but better for society in general (all of us). Yes, it won't work for everyone and there are some people who will never change and are just evil. But we tend to laser-focus on those few instead of the many who are not like that.