Of course you have to play a huge number of games for the theory to become reality, and I'm ignoring lots of other subtle factors, but in general if you only bet when the expected return is higher than the outlay then you're not actually being stupid.
The analysis seems incomplete. In particular, you also need to consider what the money might have achieved if you had invested in an alternative. In spending it on the lottery, you are also forfeiting less glamorous but more certain returns that could be made by investing it in bonds, stocks, etc. (yes, I know - stocks and bonds aren't guaranteed either).
Basically, if you are playing it just for fun and not spending a large percentage of your income on it, I guess it is OK, though generally not a good bet. If, on the other hand, you spent your college tuition on lottery tickets, you are a dumba$$ (there was actually a report about someone doing this a few years ago - they lost of course).