Punishment
Antisocial behaviour and the like display high levels of recidivism and hence are the kind of crimes most susceptible to incapacitative effects. It is shown by life-course studies  that long sentences for burglaries amongst offenders in their late teens and early twenties fail to incapacitate when the natural reduction in offending due to ageing is taken into account: the longer the sentence, in these cases, the less the incapacitative effect.

Retribution: Criminal activities typically give a benefit to the offender and a loss to the victim. Punishment has been justified as a measure of retributive justice, in which the goal is to try to rebalance any unjust advantage gained by ensuring that the offender also suffers a loss. Sometimes viewed as a way of "getting even" with a wrongdoer—the suffering of the wrongdoer is seen as a desired goal in itself, even if it has no restorative benefits for the victim. One reason societies have administered punishments is to diminish the perceived need for retaliatory "street justice", blood feud, and vigilantism.

Restoration: Especially applied to minor offenses, punishment may take the form of the offender "righting the wrong", or making restitution to the victim. Community service or compensation orders are examples of this sort of penalty.  In models of restorative justice, victims take an active role in a process with their offenders who are encouraged to take responsibility for their actions, "to repair the harm they've done—by apologizing, returning stolen money, or community service."  The restorative justice approach aims to help the offender want to avoid future offences.

Education and denunciation: Punishment can be explained by positive prevention theory to use the criminal justice system to teach people what are the social norms for what is correct, and acts as a reinforcement.
Punishment can serve as a means for society to publicly express denunciation of an action as being criminal. Besides educating people regarding what is not acceptable behavior, it serves the dual function of preventing vigilante justice by acknowledging public anger, while concurrently deterring future criminal activity by stigmatizing the offender.
This is sometimes called the "Expressive Theory" of denunciation.
The pillory was a method for carrying out public denunciation.
Some critics of the education and denunciation model cite evolutionary problems with the notion that a feeling for punishment as a social signal system evolved if punishment was not effective. The critics argue that some individuals spending time and energy and taking risks in punishing others, and the possible loss of the punished group members, would have been selected against if punishment served no function other than signals that could evolve to work by less risky means.

Unified theory: A unified theory of punishment brings together multiple penal purposes—such as retribution, deterrence and rehabilitation—in a single, coherent framework. Instead of punishment requiring we choose between them, unified theorists argue that they work together as part of some wider goal such as the protection of rights.

Criticism: Some people think that punishment as a whole is unhelpful and even harmful to the people that it is used against. Detractors argue that punishment is simply wrong, of the same design as "two wrongs make a right". Critics argue that punishment is simply revenge. Professor Deirdre Golash,  author of The Case against Punishment: Retribution, Crime Prevention, and the Law, says:

We ought not to impose such harm on anyone unless we have a very good reason for doing so. This remark may seem trivially true, but the history of humankind is littered with examples of the deliberate infliction of harm by well-intentioned persons in the vain pursuit of ends which that harm did not further, or in the successful pursuit of questionable ends. These benefactors of humanity sacrificed their fellows to appease mythical gods and tortured them to save their souls from a mythical hell, broke and bound the feet of children to promote their eventual marriageability, beat slow schoolchildren to promote learning and respect for teachers, subjected the sick to leeches to rid them of excess blood, and put suspects to the rack and the thumbscrew in the service of truth. They schooled themselves to feel no pity—to renounce human compassion in the service of a higher end. The deliberate doing of harm in the mistaken belief that it promotes some greater good is the essence of tragedy. We would do well to ask whether the goods we seek in harming offenders are worthwhile, and whether the means we choose will indeed secure them. Golash also writes  about imprisonment:
Imprisonment means, at minimum, the loss of liberty and autonomy, as well as many material comforts, personal security, and access to heterosexual relations. These deprivations, according to Gresham Sykes (who first identified them) "together dealt 'a profound hurt' that went to 'the very foundations of the prisoner's being.
But these are only the minimum harms, suffered by the least vulnerable inmates in the best-run prisons. Most prisons are run badly, and in some, conditions are more squalid than in the worst of slums. In the District of Columbia jail, for example, inmates must wash their clothes and sheets in cell toilets because the laundry machines are broken. Vermin and insects infest the building, in which air vents are clogged with decades' accumulation of dust and grime. But even inmates in prisons where conditions are sanitary must still face the numbing boredom and emptiness of prison life—a vast desert of wasted days in which little in the way of meaningful activity is possible.

Destructiveness to thinking and betterment: There are critics of punishment who argue that punishment aimed at intentional actions forces people to suppress their ability to act on intent. Advocates of this viewpoint argue that such suppression of intention causes the harmful behaviors to remain, making punishment counterproductive. These people suggest that the ability to make intentional choices should instead be treasured as a source of possibilities of betterment, citing that complex cognition would have been an evolutionarily useless waste of energy if it led to justifications of fixed actions and no change as simple inability to understand arguments would have been the most thrifty protection from being misled by them if arguments were for social manipulation, and reject condemnation of people who intentionally did bad things. Punishment can be effective in stopping undesirable employee behaviors such as tardiness, absenteeism or substandard work performance. However, punishment does not necessarily cause an employee to demonstrate a desirable behavior.

See also: 

Citations: 

References: "Punishment" . Encyclopædia Britannica. Vol. 22 (11th ed.). 1911. p. 653.
Stanford Encyclopedia of Philosophy – Legal Punishment
Etymology Online
Brooks, Thom (2012). Punishment. New York: Routledge. ISBN 978-0-415-85051-3.
Gade, Christian (2020). "Is restorative justice punishment?". Conflict Resolution Quarterly. 38 (3): 127–155. doi:10.1002/crq.21293.
Lippke, Richard (2001). "Criminal Offenders and Right Forfeiture". Journal of Social Philosophy. 32 (1): 78–89. doi:10.1111/0047-2786.00080.
Mack, Eric (2008). "Retribution for Crime". In Hamowy, Ronald (ed.). The Encyclopedia of Libertarianism. Thousand Oaks, CA: Sage; Cato Institute. pp. 429–431. doi:10.4135/9781412965811.n263. ISBN 978-1412965804. OCLC 750831024.
Zaibert, Leo (2006). Punishment and retribution. Hants, England: Ashgate. ISBN 978-0754623892.

External links: 
"Punishment". Internet Encyclopedia of Philosophy.
"The Moral Permissibility of Punishment". Internet Encyclopedia of Philosophy.