Generally I don't think spanking is necessary or valid. There is plenty of research showing that people who were spanked as children are less successful in school, socially, and in the working world as adults than those who were not spanked. It's only a correlation, but it's something to think about.
Generally violence begets violence.
However, I've used generally
very consciously, as I think there are circumstances when spanking, while still maybe not the best choice, is justifiable -- or at the very least, understandable. And I don't think parents who occasionally spank their kids are bad parents or should necessarily be chastised. I don't think as a regular recourse it is particularly effective, but, as Miss Chicken
pointed out, sometimes children do things that are dangerous and are too young to be reasoned with. My mom hit me when I ran out in the road at age 2. She hit me twice growing up, and when your mother hits you only twice in your whole childhood, those instances stand out.