The world would be an awful place if all you ever wanted was some cake but you were never allowed to eat any. You can't bake any and you are not allowed to smell the pastries. What happens when you can't have the one thing you want the most? Well, everything you look at becomes nothing but cake in your eyes. Pretty sure I saw this in a cartoon. Donald Duck goes insane. Don't make Donald insane. That's just not nice.
It's entirely possible to masturbate and not think about anything at all. So for a small percentage of people what you say might be the case, but for most, it's not a task that can only be completed through fetish, kink, and depravity. It's over and done with in 15 seconds. Not a lot of time there to fantasize about much.
It's only the people that hold themselves back and become fixated upon it trapped in a spiral of unrelenting thoughts. Thinking about a thing over and over doing nothing about it. Causing yourself to feel shame or guilt or anger or ravenous. It's like being on a zero sugar diet but having the most amazing delicious cake held in front of your face. How cruel! Why can't you just eat it? Oh, But, no! You must have willpower. You must refrain. But for how long!!? Before you know it you've done nothing all day, thought of nothing else all day. Mentally and physically paralyzed. Then it's 2 am, and you find yourself in a sorry state. you've eaten 6 entire cakes and feel disgusted with yourself. Now you repeat this cycle of psychological abuse. Soon you're taking it out on others. Shaming THEM for the way you think and the way you see the world.
And We're over there like, "are you still going on about that cake yesterday? It wasn't even that good. I barely had a bite. Hell, totally forgot about it after about 20 minutes. I've been going over my grocery list in my head. I have the most wonderfully delicious and nutritious dinner planned for tonight. Gotta hit the store after I get to the gym, then pick up the kids from soccer. Talk to you later, Oldman!"