It's like prison and retention. It's not worth it for the people it directly effects, but it is good because it encourages people to avoid it.
This here govt website suggests is the act of being caught that is the major deterrent to crime, not the severity of the punishment https://nij.gov/five-things/pages/deterrence.aspx
Original source: http://www.jstor.org/stable/10.1086/670398?seq=1#page_scan_t...
It's like prison and retention. It's not worth it for the people it directly effects, but it is good because it encourages people to avoid it.