Seems to be a mixture of both in my house: I dole it out as 'punishment', normally for cheekiness/mischieviousness or some other fun-type 'offence'.
It's done playfully but it is adminstered quite hard (often my hand hurts like hell so I can only imagine what her derriere feels like!) as it is intended to clarify who is in charge. However it would seem to be always accompanied by 'pleasure' for her as she never shies away from it, even when I smack a little too hard or miss my intended target area, and I do believe the challenge of taking the pain without giving in to it is a big part of the pleasure.
Certainly the physiology and psychology of this is complex, but then aren't most things which are fun?