The first time my ex hit me, I was 29 years old, 6'5', 14 stones. Perfectly able to defend myself, and after all it was just a firm slap of my cheek. It didn't leave a mark, it wasn't particularly sore. And I felt shocked, demeaned, belittled and I had the benefits of knowing that I could defend myself, of understanding what had just happened but it was deeply unpleasant. Why should someone be allowed to do that to a vulnerable child without the ability to defend itself, not necessarily able to understand what it was for?
I got slapped and caned as a child - I don't remember exactly how I felt about it - a bit shocked, scared, outraged I think - but I do remember most of the time what I did that got me caned and tried to avoid doing it again. I accepted that at the age I was at the time, my parents got to make the decisions (and as an aside it was really useful when I started kick-boxing to have already experienced being hit as a child and built up a slight tolerance to the shock and pain, even if it was a far less shock and pain than you experience in boxing).
Forgetting the cultural morality issue for a moment, isn't the point of slapping a child to make them do what you want quickly when you don't have time to reason with them because of an urgent situation or because you have tried reasoning with them and they won't listen and you don't have time to reason with them again or because they can't be reasoned with because their brains are undeveloped, their impulses uncontrolled etc.
If a child's brain is developed enough to understand that they dislike a slap, it's one way of dissuading them from repeating an action if the consequence is a slap. If the child's brain is not developed enough to equate the slap with the action , then slapping them doesn't work.
On the other hand they might not be dissuaded despite the slap because either you're not allowed to hit them harder or you can't bring yourself to hit them hard enough for it hurt enough to dissuade them. In which case there is no point slapping them and the only way of dealing with a situation is to pick them up and physically remove them from the situation or to stay put but physically restrain them in some way.
That's not the situation with an adult. Or more to the point, an adult with poor impulse control who has the mentality capacity to understand consequences can be sanctioned by other means - you can exclude them from your life temporarily by walking away and leaving them to it, exclude them from your life permanently, call the police, sanction them with a caution, fines and prison. None of which you can do with a young child whom you have to legally supervise.
From a morality perspective, of course governments have the right to change the definition of what is morally acceptable by outlawing slapping. IMO some of the mistakes parents make is not spending enough time talking and having fun interacting with their kids, not providing enough structure and routine and not sanctioning their kids consistently enough in non-physical ways, even if it upsets them, in order to teach them what is acceptable behaviour and to teach them to cope with not getting their own way.