The lottery is big business. In fact, many people play the lottery in the hopes of funding retirement or shoring up their finances.
I've been know to buy a lottery ticket on occasion. Sometimes, I think it's fun to play the lottery. I might win a few bucks, and I can use the money to buy myself a book or some other small treat. But I don't pin my hopes on the lottery, and you probably shouldn't, either. In most cases, you're better off taking the money you would spend to play the lottery and saving or investing it.
Rather than seeing the lottery as a way out, it makes more sense to view it as entertainment. I occasionally enjoy a gamble, but I see it more as something fun, than a viable money-making strategy. If I win something, that's great. I can get something a little extra. However, if I lose, the fact that I'm using money that I don't actually need, keeps things light and fun. I don't have to worry about breaking my finances if something goes wrong.
While there's nothing wrong if you occasionally play the lottery with “fun” money, you do need to watch out for falling for the allure of quick riches. Here is a video from John Oliver addressing the lottery, and realities associated with it. It's a serious topic, presented in a humorous way. (Language warning.)