I have recently read an interesting essay on this topic, but they had already explained it to me a few years ago.
The thesis would consist that, although the probability of winning classical lotteries is near zero (typically between 0.0000007% in the case of Euromillions and 0.000003% in the case of national lotteries), people is willing to pay an excessive overprice because they are buying the right to dream about the possibility of winning.
Although there are extreme cases that get addicted to lotteries, this is quite uncommon if I'm not wrong, because, if you are not paying for the probability but for the possibility, a bet of 1 USD is enough to buy said possibility.
On the other hand, national lotteries are known to be "taxes on ignorance of mathematics", but if these revenues financed public expenses that revert to the common good: would you agree to pay systematically 1 USD more in your annual taxes as something that ensures the right to dream of a dear life of every taxpayer?