Patman
Rodent of Unusual Size
You're assuming everyone who hits the big one gets paid the full jackpot value. They don't. It gets split amongst the winners.
It can happen, under certain plausible conditions, that the best action is to buy. As its noted, it has to beat taxes, it has to beat odds, it has to best inflation or the lump sum cut, and the possibility of massive buy in splitting the pot amongst several winners.
That being said, while difficult, this is not impossible.
Over the decades there have been examples of people trying to buy every combination... Usually the law gets changed soon after. About 10 years ago somebody tried to pull a similiar stunt in Massachusetts buying a high percentage of possible combinations. The lottery tried to change the law on the fly leading to a lot of annoyed people.
These people, who are throwing serious cash, have surmised at some point it becomes an investment more than a pure gamble. Fact is, under certain circumstances it becomes financially logical. For most of us its a high variance bet which is obscenely likely to result in a loss. But, from a risk calculation involving pure dollar totals as my endpoint then there is a point where playing makes financial sense.
Value/odds*taxvig*payoutoptionfactor/expectnumberofsharedwinners > ticketprice