Dreams of spanking someone signifies a desire to punish, and assert control over a naughty, unruly aspect of yourself.
The adult part of you is reprimanding your child aspect for acting or behaving in a way your ego deems inappropriate.
[1]Figurative of godly chastisement to correct, prevent sin, and bless
[2]