This is a great question that I've spent some time struggling with as well, so I'll share what I've learned.
1. Make getting punished a challenge in itself. Failing spectacularly enough that someone decides you need physical discipline instead of just a tongue lashing can be the goal. This makes the experience pretty similar to any other game as the goal is still clearly defined. You can reconcile this narratively by making the player character aware that they're being controlled by some outside force, but unable to do anything about it.
2. Make succeeding and failing both reward states. You can do this by making it so that behaving well results in some kind of sexual result and behaving badly results in a punishment. This has the double advantage that you can entice some of the greater erotic games market by not just being a spanking-only game.
3. Make creatively figuring out how to get punished the main gameplay loop. I remember playing a game here a while back that worked like this. Repeating the same action would just cue the NPCs that you were being a brat just to get punished and would put you in time out, but finding new ways to misbehave would result in new scenes of punishment.
4. Abandon the idea that your game needs to be won or lost entirely. Visual novels work like this. The impetus to play the game is created through an interesting story and choices that affect the narrative rather than challenging mechanics.
5. Trick the player. Present the player with a goal that initially seems righteous, but is later revealed to have been an erroneous assumption. This one unfortunately only works once because after the player realizes what you're doing, the magic will be gone and they'll know what to expect. Could still make for a pretty fun little twist in a short game though.
That's just my two cents on the matter.