According to Emile Durkheim, it was for an organized social life.
Historically, the goal of punishment was simply retribution, which basically means inflicting punishment proportional to the harm caused.
Deterrence to make the offender deter from future offending
. Example, the ducking stool was used typically for woman charged with being a common scold or sometimes for those accused of withcraft
.
Incapacitation was used to render an offender incapable of committing crime.
Rehabilitation was used to change the individual in terms of values, attitudes, beliefs, and behaviours.