unlawful sexual intercourse—for example, if he is in a place where he can readily commit unlawful sexual intercourse and his desire becomes intense, he must either relieve it through this act or go to one of the brothels and commit unlawful sexual intercourse. In such a case, we say to him: this is a religious necessity, for the established principle in the Sacred Law is that the greater of two harms must be averted by committing the lesser. This is also rational: if this person must satisfy his desire, then it is either this or that. We therefore say that this act is permissible for him out of necessity.
As for bodily need, it is when a person fears harm to his body if he does not discharge this excess that he has. Some people may have a strong sexual desire, and if they do not discharge this excess, they may develop a psychological constraint, becoming averse to socializing with people or sitting with them.
Thus, if he fears harm to himself, it is permissible for him to do this, because it is a bodily need.
But if he has no need and does so, he is subject to disciplinary punishment—that is, he is to be disciplined in a manner that deters him.
From the author's words, we understand that masturbation by hand without need is unlawful, even though he did not state this explicitly. The fact that he makes disciplinary punishment obligatory for the one who does it indicates that it is an act of disobedience, for we have previously mentioned that disciplinary punishment is obligatory for every act of disobedience. Accordingly, it is unlawful. If we say that it is unlawful, however, then evidence is required, since the basic principle regarding matters other than acts of worship is permissibility.
The evidence is the saying of Allah, Exalted is He:
“Those who guard their private parts, except from their wives or those whom their right hands possess, for then they are free from blame. But whoever seeks beyond that…”