I've known a lot of people who have said, "If I won the lotto, I would give the church so much money..."
When I was growing up, my parents had strict rules for us about money (and we were expected to start working as soon as we were eligible.)
If we got $20 for our birthday, we had to pay 10% to church, then save half in our bank account. This was just the guideline we were brought up with, and they loosened the reigns as we grew up, earned our own money, acquired our own bills, etc.
But I'm grateful for that framework and still try to adhere to it (though I obviously can't save half my income anymore, but I still allot a portion to tithes and then a portion to savings.) I've told my parents many times that one of the most important lessons they ever taught me was delayed gratification.
So I think that if I ever did have money, I'd have a solid framework to follow. "Back in the day," I was like a lot of people, buying a lotto ticket just when "the jackpot got big." I think I've only bought 2, maybe 3, in my life.
The last time I did, it was decades ago and God convicted me so heavily that I was praying I didn't win anything because I knew He was saying I'd have to give it all up.
I have never dared to buy once since but I wouldn't judge anyone who did -- maybe God is saying something different to them.
I do have times where I purchase raffle tickets (where a prize is being given away, etc.) when it's for a charity I believe in or if a young friend/relative is selling tickets for a school fundraiser, but even then -- if I somehow feel convicted, I'll just give them an outright donation without accepting a ticket.
No ticket is worth it if it wreaks havoc on my conscience.