The purpose of the law is to apply shared societal values to individuals as impartially as possible. Bad people should be "hurt" only as much as it's necessary for society to peacefully uphold those values.
Imagining the law as punishment (or worse, vengeance) is what people did thousands of years ago, and it never ended well. An eye for an eye etc etc.
Comments
If the purpose of law isn't to hurt bad guys without hurting good guys, then what is it?
The purpose of the law is to apply shared societal values to individuals as impartially as possible. Bad people should be "hurt" only as much as it's necessary for society to peacefully uphold those values.
Imagining the law as punishment (or worse, vengeance) is what people did thousands of years ago, and it never ended well. An eye for an eye etc etc.