Yama-niyama is a very demanding obligation. Contrary to what many people want them to be, in Patanjali’s framework there is an absoluteness about their compliance. Excuse is still an excuse howsoever cute and convincing and still leaves a shortfall.
They are not canons of behavior describing what is preferred and what is not. They are not superficial guidelines for only overt behavior that can at times be faked. They represent distinct classes of human manifestation and need not be narrowly interpreted as doing this or that.
‘Absence from sex’ is a classic example of loss in translation. Patanjali is not na?ve to overlook a need for perpetuation of the human species and sex is the vehicle for that. Expand it from a mere physical act to the mind’s mischief and you would know where he is coming from. Seen as a human duty, you do it and stay unconnected/unattached otherwise . And it expands much beyond that into indulgence of any kind.
Indulgence in anything is then a problem, be it sex, or eating, gambling, gossiping, judging people, TV surfing, internet addiction and so on. Self-hypnosis by our own ideas is indulgence too. High intellectual ability makes us skilled in reasoning, inferences, and extrapolation; but also makes us self-indulgent. The relative truth of the moment appears be the ultimate truth. It’s most common fallout is intellectual arrogance. A self-indulgent person would not tolerate conflicting views. But that hurts most to themselves as new learning is the first casualty.