If I Win. I Will Donate to a Good Cause
Question :
What is the Islamic ruling regarding the lottery, the lottery involves people buying tickets with numbers on them, and one or more people win prizes based on their numbers being drawn. What if my intention is good: that if 1 win, I will donate the proceeds to a good cause or to those who fight in Jihad?
Answer:
When a person buys a ticket, hoping that he will be "lucky" and win, he is participating in a form of gambling. and gambling is unlawful:
"O you who helieve! Intoxicants (all kinds of alcoholic drinks), gambling, Al-Ansab (stone altars), and Al-Azlam (arrows for seeking luck or decision) are an abomination of Shaytan's handiwork. So avoid that in order that you may be successful.
Shaytan wants only to excite enmity and hatred between you with intoxicants (alcoholic drinks) and gambling, and hinder you from the remembrance of Allah, and from As-Salah. So, will you not then abstain? And obey Allah and the Messenger , and beware and fear Allah. Then if you turn away, you should know that it is Our Messenger's duty to convey in the clearest way."
Gambling a kind of activity that oscillates between loss and profit-is not only unlawful, but is one of the major sins. No one should doubt that it is unlawful, especially since Allah Almighty mentioned it along with worshipping idols and with drinking alcohol. And though it might mean profit for some, gambling involves harms that greatly outweigh that profit:
"They ask you concerning alcoholic drink and gambling. Say: In them is a great sin, and (some) benefits for men, but the sin of them is greater than their benefit."
And you should notice in this verse that though the word that means "benefits" is plural, the word that means "sin" is in the singular. This means that no matter how great and how many the benefits of gambling may be, the fact that it is a major sin overwhelms those benefits.
Therefore playing the lottery is not allowed, even if one intends to give the winnings in for the construction of a Masjid or to fix a road, or to help those who fight in Jihad. Spending unlawfully gained wealth in these causes as a means of trying to draw near to Allah, does not mean that Allah would accept that from him, the sin would remain, and he would be deprived of any reward, because Allâh is Tayyib (good and pure) and He does not accept other than what is Tayyib.
If one buys a ticket, thinking that he will save himself from his sin by donating his prize money to a Masjid or the like, this is mere foolishness, for why shouldn't he leave the sin in the first place? For what constitutes "reason" according to the Shari'ah is that warding off sin is the rule, not that one indulge in it, then give the earnings away.
So for these reasons, it is not allowed for a person to profit from this unlawful wealth with the excuse of doing something with the wealth that will bring one nearer to Allâh. Nor is it allowed for one to attempt to gain a profit from it with the intention that if he wins he will spend it to benefit others, rather it is obligatory for the believer to stay away from what is unlawful in the first place and not to indulge in it.
Source:
Ibn 'Uthaimin
Fatawa Islamiyah, Vol. 8 Pages 269-270-271