Earlier quoted context omitted.
In these cases, yes. Of course there's also the more direct saying that lotteries are a tax on stupid people. But I don't see it that way. It's supposed to be a contract between a lot of poor people allowing one or more of them a chance at a "rich" life. If anything, it's a tax on desperate people.
Yes, (a (non-broken) lottery might be a rational choice even for someone understanding the math behind it. If you only have $20k and need $0.5M for an urgent life saving operation, then the expected payoff for not playing is -$20k (death) and it's -$20k+(some non-negative value representing the win) for spending all of your money on tickets.
Consider a lottery that sells tickets for $1 and pays back an average of 50c per ticket, with only one prize: the $500k jackpot. (This is pretty much the most favourable case for trying to raise the money by lottery.) Then each ticket has a 1/1000000 probability of winning, and (roughly) if you buy $20k of tickets then you have a 1/50 chance of winning.
Instead, you could go to a casino and bet all your money on one spin of the roulette wheel. Assuming that the game is fair but has single and double zeroes, your chance of winning is 1/38 (instead of 1/50) and if you win you get $720k (instead of $500k).
Or you could sink a lot of money into a troubled company whose stock price is very low and hope it recovers dramatically. I don't know how often such opportunities exist that have even a 1/50 chance of paying off 25x in a hurry, but I doubt it's that rare.