I turned out to be a great kid. I respect my elders and authority figures, I'm great friends with my mom, act nice in public, and never get aggressive unless provoked. Even then, there's never hitting, only firm and angry words. However, for all intents and purposes, spanking didn't work for me at all.
Tantrums were stopped in their tracks when I was little, I rarely cried, and I was even polite as a kid. The only problem was schoolwork. Every now and then, after a little slip in concentration or a desire to play rather than work, I'd get an F. My mom spanked me for it. I learned immediately that Fs were very, very bad things to get, as were Ds and Cs. But as intelligent as I was, I hated doing homework instead of playing, and I'd still get them. And I'd still get spanked. By the time I was in middle school, I'd become a horrible student due to some bad happenstances outside of my power, and I was a liar. The only thing I lied about was homework. I was terrified to tell my mom. I wasn't spanked by then, but there was still that terrible fear of punishment for something I *knew* was bad and that I shouldn't be doing. I had no will to do it. Bad, yes, but making me feel worse about it never helped. To this day I still lie when I do less than perfect or forget an assignment or two, and I'm a straight A student.
But I've seen the other kids. Sometimes, it's necessary. For me, other forms of punishment/reinforcement should have been used. I didn't need it. But some kids are impolite little shits who hate authority and don't respect anyone but that kid down the street who stole his big brother's weed that one time. Spanking is a way to associate something undesirable for the parent with something undesirable for the kid. I understood it from the get-go, but my work barely improved because I was in a bad mental state.
tl;dr: Works for some kids, but not for all of them.