And people are willing to pay more for a lottery ticket than is statistically justified by the small liklihood of getting rich.
It's a psychological quirk of human nature.
It is possible to play the lottery smartly. If the payout is high enough, the expectation value of a $1 play actually rises above $1. At that point it's an investment, albeit a very high-risk one.
If Powerball goes above $100 million, I put $5 on it. If it goes above $200 million, I put $10 on it. If it goes above $300 million, I put $15 on it, and so on.
Another consideration is that winning a large lottery is qualitatively different from winning a substantial amount of money in, say, a casino. If I won $10,000, or even $100,000, playing craps, it wouldn't make a huge difference in how I live my life. $100 million, however, is out-of-band. It lies above the phase transition between wealth and power. A single dollar among $100 million may technically be worth the same as any dollar bill, but it can do so much more. That additional worth isn't reflected in the expectation value, however.