If you limit it to about two dollars a year it's also a cheap entertainment to fantasize about hitting the numbers.
Otherwise it's a tax on people who can't do math.
The probability of winning millions from a lottery is greater than the probability of making millions from working (for most people).
-They can afford to throw away a few bucks every now and then.
-They know they have no opportunity to be so wealthy otherwise.