1. The sunk cost fallacy: Meaning the more you “invest” in something (time, money etc) the more valuable you believe it is.
2. Our brain is our most important sexual organ: Meaning that the better you believe sex is the better it is.
So, because you went through pain/humiliation/etc to get that orgasm, you believe that orgasm will be better and because of how the brain works, the more enjoyable you think your orgasm is going to be the more enjoyable it will be.
Tops may enjoy it in part because A: they’re reflecting their partner’s heightened (sunk cost fallacy) based enjoyment, B: May be experiencing some sunk cost fallacy enjoyment of their own because BDSM is complicated and they had to learn skills, and quite possibly purchase equipment to do it properly, and go through the mental effort of planning the scene