The only reason corporal punishment was used is because it causes an immediate response but that is one driven by fear. It is control by violence which is by definition a form of domestic violence. As a society we only accept it now in situations by law enforcement. But even then that is limited acceptance (for example in the United airlines incident). As a simple example, you don't teach someone to not hit someone by hitting them. Maybe that model was effective as animals but as humans we have much more powerful behavior modification techniques.
For example, the only thing that really works to modify behavior and generate long term compliance is positive reinforcement. The science is clear. Kids live in the moment. Reward the behavior you want and ignore the behavior you don't. This works surprisingly well with adults as well.
For example, teacher/student, employee/boss.
After thinking about it more, one rationalization is that we assume it's for the kids' greater good and kids don't know what's best for them while adults do. Of course, one must believe corporal punishment is an effective way to train behavior and the purpose when used is truly to improve the kid's well being.