The relation between personal wealth and personal utility is a complicated one, so your observation obviously has some merit. Ad-hoc extreme example: if I owe someone ten billions by next week or they will kill me, and I have no hope of escaping or borrowing the money, spending all of my little money on a lottery is rational since nothing else has the sky-high potential ROI I need (my function here hovers around a flat zero utility, for up to 9999999999 money).
Is the situation of poor lottery players sufficiently similar? My guess tends towards 'no'. Yes, the poorer you are the harder it is for you to 'normally' raise yourself to a decent standard of living - but since lottery tickets usually have a fixed nationwide price (unlike other comfort goods like alcohol and drugs), there is also the matter that the poorer you are the bigger the sacrifice you are making to buy those tickets. And I think that the latter factor outweighs the former.
Also, keep in mind that if we're discussing what is rational for someone to do, observations to the effect that "but they don't think like that" are beside the point - if they hold wrong ideas because of their environment/education/whatever, they're still wrong ideas.
Why do you think that similar situations do not happen in real life? Real people have been killed for not paying their debts.
I've often seen the issue of lottery tickets crop up on LessWrong and the consensus seems to be that the behaviour is irrational. It highlights for me a confusion that I've had about what it means for something to be "rational" and I'm seeking clarification. I think it might be useful to break the term down into the distinction I learnt about here, epistemic and instrumental rationality.
Epistemic rationality - This seems to be the most common failure of people who play the lottery. It might be an overt failure of probabilistic reasoning like someone believing their chances of winning to be 50-50 because they can imagine two potential outcome. Maybe they believe that they're "due" to win some money as they commit "the gamblers fallacy". Or it might be a more subtle failure resulting from correct knowledge of probability, but a fundamental inability to represent that number we call "scope insensitivity". I think in the cases where these errors are committed, no-one would argue that these people are being "rational".
However, what if someone had a perfect knowledge of the probabilities involved? If this person bought a lottery ticket would we still consider this a failure of epistemic rationality? You might say that anyone with perfect information of these probabilities would know that lottery tickets are poor financial investments, but we're not talking about instrumental rationality just yet.
Instrumental rationality - Now we're talking about it. The criteria for rationality in this case is, acting in a way that achieves your goals. If your goals in buying a lottery ticket are as one dimensional as making money, then the lottery is a (very) poor investment and I don't think anyone else would disagree. Here is where I start getting confused though, because what happens when a lottery ticket satisfies goals other than financial gain? It is conceivable that I could get more than $5's worth (here meaning my subjective and relative sense of what money is worth) of entertainment out of a $5 lottery ticket. What happens here? I hope you can see the more general problem that arises if you'd answer "It's still instrumentally irrational".
I'm not arguing that the lottery is a good idea or that it's socially desirable. I think that it does tend to drain capitol from the people that can least afford it. If you've argued the idea of the lottery to death, pick a different example, it's the underlying concept I'm trying to tease apart. I suppose it boils down to the idea that if an agent makes no instrumental or epistemic errors of rationality, and buys a lottery ticket, can that be irrational?