I have to disagree. I know a fair number of people who play the lottery. It is a minority of them who only play it for harmless entertainment. The majority have deluded themselves into thinking they have a meaningful possibility of winning.
Of course, if you specifically ask them about the odds of winning, they know that they are very small. But when they are going to buy the tickets, the back of their mind is telling them "this is going to be the time!"
It's much the same with gamblers. Some just do it now and then for a little fun. Others really convince themselves that they just need to play the slot-machines a few more times, and they will hit the big jackpot! (Though, of course, if they DO win big, that just convinces them to keep on going back and going back until they have lost it all again.)