Indeed. There's a lot of internalised feelings about degradation and punishment that are often tied to concepts like spanking. This is something that may or may not be worked through as you explore your sexuality and either way it's valid, so long as you don't project your internalised feelings onto others.
Even now, as free as I feel with my partner in my sexuality, part of me associates spanking in my mind with "you did something wrong and should feel bad about yourself". I think it's because when I was a child I was spanked and belted a couple of times for misdeeds, and the emotional pain and guilt was much stronger than the physical pain. Likewise a lot of porn that shows spanking as being a "punishment" and shows the recipient crying and saying "sorry". Again, associating guilt with spanking. And emotional pain is something that I never want to associate with my joyful lovemaking.
That said, I recently shared a fantasy with my love (assigned male at birth but nonbinary, goes by different pronouns depending on which aspect they are embodying) who was expressing her female aspect, and we were doing a teacher fantasy, and in the fantasy I was swatted on the butt a few times with a ruler for making a mistake while distracted by sexy stimulation, and I liked it in that context! So I think it can be unlearned, the feeling of "punishment being something that you feel emotionally bad about". Instead spanking for "being naughty" or "making a sexy mistake" can be seen more in the context of "the rules of the game that we both agreed on say that when X happens, you get a spank, and we both know you like that, and so you'll be put in predicaments where such a thing happening is likely to occur".