It's ineffective. Violence begets violence. Inflicting physical pain on someone you believe has committed a wrong, is itself an act of violence. It perpetuates it. It teaches it to the victim of it and to the giver of it.
If I were to relate this to the Christian religion, Jesus taught against it. He rejected the old form of an "eye for an eye, a tooth for a tooth" form or retributive justice. He instead taught the way of nonviolence. "Turn the other cheek. Do good to those who harm you." Other NT writers echoed that themselves, "Do not repay evil with evil or insult with insult. On the contrary, repay evil with blessing".
Violence begets violence. Love begets love. If you render love to those who have done wrong, you break the cycle and teach a better way.
Plus, from a modernist perspective, studies have shown that corporal punishment does no good in reforming behaviors. At best it simply represses the violence, not changes the source of violence within them. It doesn't get to the root of anything.