Intention must also be considered here. If a person intends to occupy himself with something permissible in order to avoid what is forbidden—for example, looking at his wife and having intercourse with her in order to refrain from looking at an unrelated woman and having intercourse with her, or eating lawful food to keep himself from unlawful food—he is rewarded for both this intention and the act. The Prophet, peace and blessings be upon him, explained this when he said:
“In having intercourse, each of you has an opportunity for charity.” They asked, “O Messenger of Allah, can one of us satisfy his desire and receive a reward for it?” He replied, “Consider: if he satisfied it unlawfully, would he not incur sin? Why, then, do you count the unlawful against yourselves but not count the lawful in your favor?”
Another example is his saying, peace and blessings be upon him:
“Allah loves His concessions to be taken, just as He hates to be disobeyed.”
This was narrated by Ahmad and by Ibn Khuzayma in his Sahīh.
It may be said that a permissible act becomes obligatory in this respect: if it is the only means, it becomes specifically obligatory; otherwise, it becomes one of several obligatory alternatives—but this is with that intention. When a person is oblivious to this, however, it is not obligatory at all except insofar as a means of refraining from the forbidden is obligatory. Refraining from what is forbidden does not require intention; the same therefore applies to the means by which one refrains from it. Thus, there is no objection to saying that an act is permissible in itself, yet may become obligatory as one of several alternatives because it serves as a means. The dispute in this matter is therefore one of wording and perspective. Otherwise, whoever understands the sound meanings does not dispute them.
The point here is that the righteous and those on the right may occupy themselves with a permissible act