Lottery addicts certainly can't do math since they waste a lot of money on tickets. But a good many other people just buy one a week or just occasionally, eg when there's a particularly large jackpot on offer. This isn't so irrational; a regular player will make a few bucks back over the year on small prizes, and the risk/reward ratio improves for a big jackpot even though the odds don't.
It's worth recalling that while the odds on any individual ticket are awful, enough people are playing that people do win big prizes on a semi-regular basis. For small-spend players who can afford it, and may think of it as semi-charitable given the uses to which lottery profits are put, is it really any more irrational than certain kinds of insurance?
Some people get a kick out of the whole buy a ticket, wait for the numbers, get excited dreaming thing.
For some folks, it's entertainment.