When adults don't follow the rules we don't hit them because we remind them of the rules, or fine them, or arrest them and put them in jail since we assume they're responsible enough to accept the consequences of their actions. Aren't children supposedly not always able to accept the consequences of their actions because of their maturity/developmental level? If reminding kids of the rules doesn't keep them from breaking them what can we do? It wouldn't be fair to punish them like adults because in some ways they aren't as responsible for themselves as adults, but we can't just let them do whatever they want.
When a parent punishes a child for doing something wrong, that punishment generally includes a restriction on their freedoms. This alone for a child is a pretty good reason not to do whatever it is they did again. In the case of stealing, for example, a parent could take away a child's favourite toy for a time and then sit down with the child to drive home the message. Only after the parent is satisfied that the child has learned the lesson is the toy returned.
There are many ways to properly discipline a child and instill in them a sense of what is right and wrong without having to resort to violence. And yes, spanking is a form of violence. In my view, it is only the lazy parent who has to resort to hitting their child's behind to drive home a lesson.