It is important for parents to socialise their children. This is no easy feat. Children are thinking human beings, and human beings are not pets that can be domesticated. However, spanking falsely lulls parents into a feeling of doing right discipline by making them believe that hitting a child teaches them to behave well. Hitting a child, or indeed a dog, will teach it that there is a negative reaction to certain actions they perform. This falls into the behaviourist school of psychology. However I would call it naive behaviourism, because just as you can teach a rat to to avoid a certain behaviour with an electric shock, teaching a child the same way can cause deficiencies in the resulting adult human being.
Parents who spank their children are saved from the tedium of teaching their children why a behaviour is wrong or right, and instead teaches them to avoid a behaviour due to the fear of punishment. Children who are spanked exclusively will not learn to use reason to navigate morality, but rather learn that something is only bad when you get caught.
Teaching a child to reason about morality is much more important than spanking them, and I will say with confidence that if you can teach a child to decide between what is right and wrong and nurture their conscience, the threat or action of physical punishment will be unnecessary. In fact, it would be unnecessary and excessive.
Spanking also wrongly indoctrinates children into the concept of retributive justice, where punishments are measured out to somehow cancel out an immoral action. This plays into defences of the death penalty, harsh punishments for minor crimes and the "that'll teach them" attitude. If a child is raised with the idea that violence is a means to justice, then that is what they will carry over in their adult lives. Stealing is not wrong because you will be punished if you do it. Stealing is wrong because it hurts someone else. Indeed any crime is a crime because it creates injustices in the world.
When using violence as opposed to reason as a means of discipline children can also falsely come to believe that what is wrong is whatever everyone else believes is, or what some authority, like a parent tells them is, because violence is arbitrary and teaches nothing but the avoidance of pain. It shouldn't be surprising or ridiculous to say that it is possible that a subsection of society can come to believe that it is a crime to eat bananas on a Tuesday, and to violently attack those who do so, because no moral reasoning is involved. All morality becomes convention based on what is socially acceptable, rather than what is morally right.
If we as a species want to raise children that are better than us, that stand up for the oppressed and against injustice, how do we suppose we can do so by being violent towards them? How can we nurture reason and bravery through fear of violence? I am by no means trying to say that children who are spanked will never be able to attain ethical enlightenment, but I am asking how it can be logical to think that this is a good way to nurture such enlightenment?
I think that we can say that in the ideal society, there would be no violence. Violence would be a taboo that nobody wants to engage in. If we think that the cessation of violence is a worthy goal, then starting this process at home would be the absolute ideal.
I am not saying that it would be easy. In fact I think that hitting children is an easier way to discipline them, but we don't decide on right action based on how easy it is. It is difficult to teach children to think about morality and their effect on others and the world, but it would result int adults who are more well rounded and able to make their own moral judgements, apart from popular opinion, authoritarian decree or selfish desires.