Rehabilitation and sequestration are ways to protect and help people after a crime has been committed and presumably after the victim has suffered.
Punishment for deterrence--if it actually deters--can do something else entirely, it can prevent the suffering of the innocent and prevent new criminality by increasing the suffering of the guilty.