Just for fun, you could take the money you'd spend on a lottery ticket and hand it to the next person you see, just to see how they react.
If you're not just barely scraping together, dropping $25 on a negative EV lottery is not going to make one whit of difference to your finances. But it might change your life.
Dropping $25,000 on a positive EV lottery, on the other hand, is an incredibly dumb move.
Since most poor people will, in fact, miss that $25, the lottery is a really bad idea for them. Yet, they play it a lot more than the middle class do...
Since you'll almost certainly lose, I think the true value is in the fantasy of what you would do with a staggering amount of money. You could do this without buying a ticket, of course, but it feels more real when you have some skin in the game. Mathematically, your odds are still effectively zero, but mentally there's a big difference between effectively zero and actual zero.
Thinking of other consumables in that general price range that provide a short, quick fix of enjoyment (cup of coffee, snack, etc.), $1 for a slightly more vivid dream isn't so crazy to me.
Having said all this, I highly doubt it's the mentality of most lottery players.
I normally get a couple of tickets when the Euro lottery gets large - just for fun.