It's an easy product to sell. They gamified the lottery. Complete with a faster turnaround time, higher frequency, and stronger dopamine hits. The winners are more visible too.
The lottery is one of the more innocent gambling game. The delayed reward, low chance of winning small amounts, and fixed schedule makes it so that it is not nearly as triggering of addictive behavior as other gambling games.
Personally I think the lottery should still be illegal, but it provides a good baseline. Any gambling game that has more effective contingencies then the lottery should at least be heavily regulated (possibly banned). And stocks definitely do.
I guess it's a bit like the Japanese government turning a blind eye to the pachinko parlors.