Every form of gambling has to be a losing proposition for the player or the gaming industry wouldn't offer it. A casino or lottery cannot remain viable by having games with even odds. If someone figures out how to shorten the odds (like card counters in blackjack), the casinos will modify the rules. They are not running a charity. Someone is paying for all the lavishness of the casinos and the players should realize who that is.
No one so far has addressed the economic reason to buy a ticket. Sure the expected return is negative, but that isn’t all there is to it. If it were no one would ever but insurance. Here if you win at least you’re happy. If you win with insurance you are generally unhappy. The economic term is skew preference.
What is being “sold” is a fiction, to collect more “taxes” from willing participants.
In addition to the feds taking 40% of all the “winnings”, the states take 50% or more of the bets off the top.