"so there is direct correlation between the bad behavior and the punishment."
We're talking about humans, not rats.
Animals need that sort of immediate feedback because you can't get the point across otherwise, but humans can communicate. They understand the correlation exactly if you tell them.
The punishment can be delayed to a later time where you can again sit down explain what they did, why it is wrong and give them the punishment.
Besides, the parent has time to cool down, but you must follow through if you said you were. You shouldn't promise a spanking and then back down or else your threats will mean nothing.
Use spanking sparingly. You don't want to have too many rules about every little thing or you just end up playing the policeman all the time.
Set behavior boundaries and stick to it. But don't go overboard or you can not enforce your own rules.
Nothing wrong with spanking, though, in the right context.