Actions have consequences. Anyone who believes that inflicting pain on someone else doesn't have negative, long-term impact on both the person who onto whom the pain is being administered as well as on to the person inflicting the pain is deluding themselves.
The issue reduces down to relative merit: Is the damage done to the pain-receiver combined with the damage done to the pain-giver less than or greater than what the pain-giver hopes to achieve in terms of positive impact from the infliction of the pain?
How to know? Each person can inject their own perspective, but such comments are easily dismissed by simple contradiction: I think your perspective is wrong and mine is correct. However, in this case, one tool we can use is to look rationally at the foundation of each perspective for clues to the actual truth. Is the perspective soundly founded? ... or are there objectively clear signs of fallacy on which one perspective or the other is based?
I think it is very telling that most folks who advocate infliction of pain as a human disciplinary tactic refuse to accept and consider the long-term damage that such action causes, to the pain-receiver and to the pain-giver, as well as to society as-a-whole. Generally, when an advocate refuses to acknowledge realities like that it tends to indicate a realization that, when all the considerations are taken into account, what they are advocating will end up with a failing grade. They will fight tooth-and-nail to blind themselves and others to the realities that undercut what they're advocating, presumably because they're unable or unwilling to pursue other approaches that accomplish the same ends without causing harm. They'll extol the short-term benefits and ignore the long-term ramifications.
So while I don't find the anti-spanking perspective unequivocally definitive, by itself, the fallacy on which the pro-spanking perspective is typically dependent helps make clear that spanking is not the right answer.