Is there any problem with having a fund raiser where everyone buys a ticket by giving a donation to a shule and the winning prize is a sefer torah? Is that being mezalzel a mitzvah or is there no zilzul as without the lottery no one would be able to afford to pay for a sefer torah to be written? Any sources would be great. Thanks for this site. Its really useful. Can you sign up for the parasha and halacha to be sent to your email?
Panim Me’iros (3:43) writes relates to a case in which a person went broke and lost all his possessions save a sefer Torah, which he needed to sell in order to marry off a daughter. After unsuccessfully trying to find buyers, he decided to try a lottery. Panim Me’iros writes that this is permitted, because it is for the benefit of the Torah, which currently has no buyers. This answer is quoted by Atzei Chaim (YD 30).
However, Zera Avraham (YD 7) writes that the practice is prohibited, comparing the sale by means of a lotterty to the disrespectful sale of the meat of a firstborn animal (which is prohibited). Tzitz Eliezer (vol. 22, no. 50) adds that Chacham Tzvi (123) prohibits the sale of a sefer Torah by means of an auction, and compares an auction to a lottery (though there is room to debate the comparison).
He concludes that the the lottery is not respectful. However, for the purpose of a mitzvah (which includes raising necessary funds for a shul), one can rely on the opinions above that permit the practice.