To play (verb) is to occupy oneself in amusement, sport or other recreation. Perhaps to act in jest or sport; "They're not quarreling in earnest, they're just playing." The dictionary offers numerous variations on the idea "to play."
In consensual spanking, spankee and spanker (perhaps "players") are playing a "sport" or acting out a "game." Whether a spanking is fantasy or real life, participants generally agree they are playing to entertain themselves. Playing out a spanking often builds high levels of erotic energy, such that players want to return to the scene again and again.
It is common to invent a device that rationalizes the playing, i.e., the spankee will deliberately break a "rule," knowing the spanker will start the game. Scene and setting are elements in playing out a spanking because they help set up the sport and action for the players.