As I mentioned in another reply, I agree with that wholeheartedly. That factor of punishment is called deterrence.
I am in favor of punishment for deterrence, denunciation and incapacitation. I am not in favor of punishment for retaliation (punitive justice) or rehabilitation (restorative justice).