The law isn't and never has been a moral benchmark. At best, a law reflects social consensus at the time of its enactment, but even that's not a given.
And proportionality matters. Community service and counseling, loss of time (imprisonment), and loss of a hand have all been used to punish theft. Which is correct? Which is the more moral, because it doesn't seem to me that they're the same?
I think there cannot be an objectively most correct punishment for a given crime. The closest we could maybe get is "undo the harm that you have caused", but some harm cannot be undone.
Hence morality and ethics, I guess.