They are two different things. Gambling is for make money, sex is for relaxing. I don't like gambling. I prefer the first.
sex can be for make money. and gambling can be for relaxing.
subjective
But to answer the question. There is nothing wrong with either, but beware of letting them control your life.
I don't like sex with someone im not attached to because if its just to bust a nut, i may as well jack off. I like tantric sex, hours riding the waves of ecstasy, transcendence.
Gambling is pointless unless youre risking yourself. Gamble with your life, gamble with a part of yourself invested. If you're buying in, it should affect your life.
But if your not into high-stakes, everything else should be recreational, IE don't get mad if you lose. At least youre still alive.