Consider a risk-averse agent (whose utility for money is strictly concave) that maximizes expected utility. Would such agent ever a accept a gamble whose expected value is negative? (E.g., think of state sponsored-lotteries Lotto 649, or Atlantic lotto, etc.)
More formally, consider an agent with a utility function $u$ that is increasing and concave, e.g., $u(x) = \sqrt{x}$. Define a lottery $L$, with probability $\alpha$ for a low state $x_l$ and probability $1-\alpha$ for a high state $x_h$, that has negative expectation, i.e., $E[L]<0$. Assume initial wealth $W$ that is then higher $E[L]$. We say the agent will accept the lottery $L$ iff her expected utility from this lottery $E_u[L]$ is higher then her utility without the lottery. The question is: given that $E[L]$ is negative, can we say that the agent with a concave utility function $u$ will never accept the lottery $L$.
For risk-averse people with many good alternatives for spending small sums of money, an occasional lottery play is portfolio diversification.
For poor people or ones without good alternative micro-investments (and, typically, many bad options), there are all sorts of reasons why saving one more coin is not necessarily more appealing than using it sometimes to purchase a lottery ticket.
Expected value is a meaningless metric for the lotteries with low odds and low entry costs. The positive part of the expectation would usually take thousands of lifetimes to realize, and the negative total can be mitigated or maybe even reversed (the analysis is complicated) by playing selectively when the jackpot is large.
One of the more famous Berkeley mathematicians (Chern?) had a Ph.D student who won millions of USD in a lottery and donated some of the money to the department. It is hard to say how many such windfalls might have been lost by math departments that dutifully taught students never to invest for negative expected returns, but it is food for thought.