I've heard this argument before about casinos, but never lottery tickets. I'm not sure I personally buy that, but let's go with it.
If they're entertaining, then presumably it's from the thrill of maybe winning. Why would winning be thrilling? Why, because you get money- potentially a life-changing amount of it. If they made a lotto game with a maximum payout of a dollar I'm reasonably certain nobody would play it. Or hell, anyone could write down a series of heads/tails on a paper and then flip a coin to see if they're a winner! Yet, we don't see that, even though it's free and (I would argue) has the same entertainment value.
So yeah, I'm sure entertainment is the facade, but underneath it all, it's financially motivated for the vast majority.