The simple story of pleasure is that animals evolve to enjoy what’s good for them; pleasure is the carrot that drives them toward reproductively useful activities. (Pain is the stick.) It feels good to drink when thirsty and eat when hungry because animals that were inclined to feel such joys left more offspring than those that weren’t.
This logic easily applies to sex. If one animal seeks out opportunities for mating and the other is indifferent, then, all else being equal, the first will have more offspring. From an evolutionary perspective, chastity is genetic suicide: You can’t have offspring without sex, and sex, like food, is the sort of thing that you usually have to work to get. We have therefore evolved a motivation to seek it out. The pleasure of sexual intimacy poses no puzzle at all.
This evolutionary analysis is simple, but it provides a starting point for ...