The lottery may be a horribly-regressive tax, but it's better than the situation that existed before it was legalized. It's akin to the situation with illegal drugs. If governments started selling them at a slightly-lower price and with higher quality standards, you could still argue that providing drugs to people is making them less healthy. But the situation would be better than what we have today since the states would be making the profit, we'd be rid of the associated crime and many of the overdoses that result from variable quality of street drugs.
If two people have the same exact habit it will cost them the same amount. If I have a higher income than you I'm actually paying less relative of my income than I would with a normal tax.
This is true even not considering the social aspect of it. Some of this taxes are on addictive things like drugs (tobacco, alchool) and gambling (lottery). And one social influence of addictive behaviour is poverty.
The lottery, however, is worse. It is actively advertising to these people, encouraging them to have hopes and dreams about a way out of their situation, but instead it just kicks them while they're down. And it's not just some soulless corporate entity doing this, no: it's the same government which purports to care about their plight, not just exploiting them but encouraging them to passively hope for unearned success, instead of pursuing goals as an independent actor or something which might actually improve their lot.
"Hey, you never know!" is a dystopian lie, a few increments worse than "A new life awaits you in the off-world colonies! A chance to begin again in a golden land of opportunity and adventure!"
Buying lottery tickets looks irrational on basis of expected value, but it is a very narrow and somewhat self-contradictory definition of rationality.