If you do what I do not wish, I can hit you. You should be very, very careful that I don't catch you doing something wrong. Ill-behaved children aren't much fun for anyone to have around. If spanking actually worked, I might have to concede that its harmful effects were outweighed by the benefit. But that isn't the case.
Children learn a lot by imitation.
I want my children to learn non-violent ways of dealing with people. After all, I hope to be alive when my children are adults. I may need care from them someday. I don't want to be hit because I'm querulous or angry then. I won't hit mine now.