There is more than one function to the justice system, and it doesn’t always result in what appears to be justice.
We are trying to rehabilitate people, to deter others from committing crimes, to give a sense of retribution to victims, to take the offendor out of society for our own safety, or perceived safety, and also to restore (to some extent) damage done to the victim and the social fabric.
and at the same time, we want the punishment to be relatively proportional to the offense….
these desires may often, very often, conflict with one another.
That is the nature of punishing crime with more than one goal in mind…