That's naive. Many if not most people know quite well how dim their chances are to win. In Europe, they're told before they can play what the probability for a class 1 win is, like 1:160,000,000 for the Eurojackpot lottery. But they also know that most lotteries spend a substantial amount of their earnings for good causes, so the money is not just lost (in Eurojackpot, I think it depends on which country someone's in, but it's things like sports, culture, humanitarian projects). And most of all, beside the actual playing fun like when teaming up with colleagues, it's the difference between a however dim chance and no chance at all to escape the reality of having to work a shit job until old age for too little money.