I don't know.
The natural reaction of parents is to spank. Psychological knowledge still doesn't know shit compared to instincts.
There MUST be something beneficial about it.
I have an enormous family, not immediate but like 9 aunties and 3 uncles on one side and 5 uncles and 2 aunties on the other, add to that their spouses and I have scores of cousins.
Anyway, what I'm saying is I've spent alot of time observing parent-child interaction, something I've noticed is the time when parents really have a hard time controlling themselves is when their kids put their own life in danger.
When parents spank over their child being embarrassing or a brat its a different type of frustration.
I don't think spanking in those cases is warranted and its more of a conscious anger, it only happens because there is a society in which people are expected to act a certain way, when a kid doesn't a parent gets embarrassed or whatever, but this is not natural.
But when a kid is playing with a snake, or lying on train tracks I think taking the child away from the danger and then putting him in the danger of a wooping is beneficial.
This would have been a very important thing to do back when life wasn't so safe and easy and medical attention didn't exist.
As I said other animals do it, your child's survival is more important than its having a non-smacked-ass, or non-blowhole-burned pectoral or whatever your style is.
So I think spanking is right in some cases, I think everything we naturally have the urge to do must have spawned from a behaviour that was "right", not just right but required for survival.
From eating to murder.