In all its legislation and moral injunctions, Islam lays great stress on nobility of feelings, loftiness of aims and purity of intentions. The Prophet (peace be on him) said:
“Actions will be judged by intentions, and everyone will be recompensed according to what he intended.”
Indeed, in Islam routine matters of life and its mundane affairs are transformed into acts of worship and devotion to Allah by good intentions. Accordingly, if one eats food with the intention of sustaining life and strengthening his body in order that he can carry out his obligations to his Creator and other human beings, his eating and drinking are considered worship and devotion to Allah Ta’ala. Again, if one enjoys sexual intimacy with his wife, desiring a child and seeking to keep himself and his wife chaste, it is considered an act of worship on his part, deserving of reward in the hereafter. Concerning this the Prophet said:
“When you satisfy your desire with your wife, it is counted for you as an act deserving of reward.”
Those who were listening to him said:
Messenger of Allah, how can it be that one of us satisfies his desire and will then be rewarded for it? The Prophet replied: “Would he not be sinful if he had satisfied it in a prohibited manner? Consequently, if he satisfies it in a permissible manner, there is a reward for him.”
He also said:
“Anyone who desires what is permissible from the world, keeping himself away from sins, working for the sake of his family, and taking care of his neighbor, will meet his Lord with a face shining like the full moon.”
In this manner, whenever any permissible action of the believer is accompanied by a good intention, his action becomes an act of worship. But the case of the haram is entirely different; it remains haram no matter how good the intention, how honorable the purpose, or how lofty the aim may be. Islam can never consent to employing a haram means to achieve a praiseworthy end. Indeed, it insists that not only the aim be honorable but also that the means chosen to attain it be pure. “The end justifies the means” is not the maxim of the Shari’ah, nor is “Secure your right even through wrongdoing.” This can never be, for the Shari’ah demands that the right should be secured through just means only.
If someone accumulates wealth through usury, forgery, gambling, prohibited games, or in any other haram manner in order to build a mosque, establish a charitable foundation, or to do any other good work, the guilt of having done what is haram will not be lifted from him because of the goodness of his objective. In Islam good aims and intentions have no effect in lessening the sinfulness of what is haram. This is what the Prophet taught us when he said:
“Allah is good and does not accept anything but good, and Allah has commanded the Believers, as He commanded His messengers, saying, ‘O you messengers! Eat of whatever is good and work righteousness.’”
“Indeed, I am aware of what you do.”
He also said,
“O you who believe!”
“Eat of the good things which We provide for you.”
The Prophet then said,
“A man travels far, unkempt and dust-stained (for hajj, umrah, or the like), raising his hands to the sky (and saying),
‘O Lord!’ while eating what was haram, drinking what was haram, wearing what was haram, and nourishing himself through haram means.”
He also said:
“If anyone amasses wealth through haram means and then gives charity from it, there is no regard for him and the burden of sin remains.”