Q. Is it wrong to buy a lottery ticket?
On Yom Kippur in Temple times, lots were cast to decide which goat would be designated for God and which for Azazal (Lev. 16:8). The allocation of territory amongst the tribes was carried out by lot (Num. 26:55). The Mishnah reports a lottery to determine who would carry out the Temple service (Yoma chapter 2, Tamid chapter 1). Some congregations cast lots to decide who would recite Kaddish or be called to the Torah.
However, there was a fear of compulsive gambling, and a person who had no profession other than gambling was not permitted to be a judge or witness (Mishnah Sanhedrin).
Buying a lottery ticket or taking part in a raffle is much less of a problem; the amount one invests is tiny, one hardly expects to win, people are light-hearted about it, and the exercise is usually in aid of a good cause. Though the results cannot be predicted, no-one elevates it into a theological principle that man is helpless before his fate.
God, not Kismet, rules the world and directs the course of history. Things that seem the result of random chance are part of the Divine plan; Joseph says to his brothers, “It was not you that sent me here but God” (Gen. 45:8), and even when an opportunity appears to come out of the blue it must be God at work (a German proverb says that business success is the four Gs – “Geld, Geduld, Genie and Gluck”, capital, patience, capacity and luck – but all require the Guiding Hand from On High).