When you buy a lottery ticket, you're not buying a chance of winning the lottery: you're buying a dream. My MIL has occasionally had to advise extremely poor people - people who have to choose between feeding or clothing their children. When looking at their weekly outgoings, there's often a lottery ticket or two in there. She used to try and persuade them to give it up, but after hearing too many people call it their "only hope" she stopped. People need to dream. People need to hope, otherwise they've got nothing.
Personally, I don't buy lottery tickets, but then my life isn't yet a crushing pit of despair.