I also get a lot of joy from all of the things you describe.
The fact that the pleasure you get from sex or exercise feels artificial in comparison to writing a piece of code might be something worth thinking about. Is this really how you feel, or is it how you were programmed to feel?
I guess what I mean to say is that sex and exercise (not to mention drugs) are more like quick fixes. You can just do it and feel happy for a while. On the other hand, producing something involves more investment and when this investment pays off, the resulting "high" feels more earned or deserved. To my mind it also feels less buzzy or chemically induced (although I am well aware that triggering your reward centres by making something is a chemical process as well).
It sounds like you are talking about visceral happiness vs reflective happiness. Two distinct kinds of happiness according to some researchers (i.e. Martin Seligman).
There is an investment in exercise you just need to set goals. I went from never running 4 miles to completing 55km mountain runs. Then switched up and went from 800lbs powerlifting total to a 1300lbs total and still looking for more.
No citizen has a right to be an amateur in the matter of physical training…what a disgrace it is for a man to grow old without ever seeing the beauty and strength of which his body is capable. - Socrates
I like this, I think this sort of investment gives you(me) a foundation for happiness feelings to sit upon. Which otherwise can deflate quickly if it comes at the end of an unproductive(ineffective) day