Supposed to be a deterrent - people don’t want to be hit or beaten.
Public acts of corporal punishments such as being beaten in the town square is intended to put people off from committing crime.
Islamic law allows for corporal punish ent for repeat offenders.
Negatives of corporal punishment
It doesn’t reform people.
In the bible Jesus told his followers that “ if someone strikes you on the right cheek, then offer them the other cheek also.” In other words give people a second chance.
Jesus also said that people who use violence only breed violence in other people (“he who lives by the sword, dies by the sword“).
The Shari’ah permits corporal punishment it is not a way of deterrent and it’s better to forgive.