Answer: The Mishna (Bava Metzia 34b) writes that one mustn’t profit from another person’s animal that they are looking after. R’ Yisroel Yaakov Fisher (Even Yisroel 8:64) compares this to one’s maaser money, writing that one cannot use one’s maaser money for raffle tickets that one could potentially profit from. If one were to use one’s maaser money, any prize won would belong to the tzedaka organization.
R’ Moshe Feinstein (Igros Moshe OC 4:76:2), however, writes that it depends whether there are a limited number of tickets for sale. If there are say only 100 tickets for sale, then each ticket is technically worth one percentage of the prize value. One wouldn’t be able to use one’s maaser money for such tickets as one is essentially buying a ticket for oneself with that money. If the tickets aren’t limited, however, then the tickets do not have a specific value, per se. One would be able to use maaser money to buy such tickets. Even if one used maaser money for such a ticket and won, they would be able to keep the prize as it is considered a gift from the organization. R’ Moshe advises that the winner give the maaser of their winnings back to that institution.
R’ Moshe Sternbuch (Teshuvos Vehanhagos 3:289) adds that when one runs a charitable organisation, there are necessary expenses. Just as it is acceptable to pay one who fundraises, so too, it is considered acceptable for the charity to give away prizes by way of a lottery in order to raise funds. If the charity couldn’t do that, they would lose out. Regardless as to whether there were a limited number of tickets or not, one could use one’s maaser money to buy the tickets (See Shevet Halevi 9:200).
In conclusion, one may use one’s maaser money to buy raffle tickets for tzedaka as it means that people will give money to this charity that may not have done so otherwise. What one wins belongs to them.