It's not just pleasure. It's intimacy, bonding hormone levels rising, etc. Why is it pleasurable? Because of evolution. Sex is complicated.
https://xkcd.com/592/
People thought that after the pill, sex will become simple and uncomplicated, just have orgies for fun all the time. But it's not happening on a large scale even in the very liberal societies. There was a brief moment with the hippies, but it didn't last long. Yes there is hookup culture, but it's far from uncomplicated. It's not everyone can easily participate in and has its own little games.
It's one of the fundamental components building our social fabric.
Why does pleasure have to be earned? I'm not sure I subscribe to that, I probably need a few decades more of contemplation and experience to answer such a thing. I'm just saying that there is such a template in many people's moralities. I think it's kind of silly, because the universe doesn't care, it's not a vending machine to put in hard work and get rewards. It's way more random and unpredictable than that. Sometimes something easy gives you lots of reward, and toiling away in the wrong way leaves you with nothing. But on the whole, on a large scale, on a population level, at the expectation, you cannot get something out of nothing, it seems. It's not a law of physics or anything. It may also seem pseudo-religious. But overall it seems to be the strategy that people adopt who achieve things. That you need to put in effort to reap rewards. Otherwise all kinds of things can happen, like hedonic adaptation, setting your baseline at a different place, inflation of the value of things etc.