An undeserved spanking is a punishment spanking given to someone who has done nothing to deserve it. It can be that the spankee is believed to have committed a sin, while in fact he or she is innocent. Or it can be a spanking given for no reason at all, just because the disciplinarian felt like giving a spanking. Or it can be a spanking given not for a committed offense, but as a means to remind the inferior of their subordinate status, and what to expect if they should fail to be at their best behaviour.
An undeserved spanking typically raises feelings of hurt, self-pity, anger and/or hatred towards the punisher in the one who is punished without having committed a wrong -- much more than other injustice such as a spanking that is too hard in proportion to the offense committed when there is an actual offense. It can also raise the feeling of helplessness when the person realizes that he or she can do nothing to avoid future punishments. For example, in the Story of O, the protagonist is informed that she will get whipped daily, not for anything she has done but just to remind her of her situation.
The opposite of an undeserved spanking is called a well-deserved spanking.
Consensual undeserved spankings
Maintenance spankings as part of a domestic discipline lifestyle can be seen as a special case, because although by definition they are undeserved, they are part of a consensual agreement. The same applies to any "undeserved punishments" in a consensual BDSM context. A submissive may actually love the idea of being subjected to punishment whenever their dominant wishes to do so.
A spanking which is not given in punitive, disciplinary intent, such as a fun spanking, birthday spanking or erotic spanking, is usually undeserved too, but generally not called so, because it is not actually a punishment even if it may come with the outward appearance of one.
Then down both their trousers she took,
While each stroke made them furiously squall:
'Oh why, mamma, what are you at?'
'My dears, I'm at "nothing at all".'
– Rhyme from a mid-19th century children's toy-book, quoted in Flagellation and the Flagellants