If for example, you have a steady job and you earn enough money to pay all your bills and save / spend an amount of money per month, then you will be content to the fact if you save for a few months you can afford that 'thing' you desire.
If however, you are technically poor or your job barely covers the cost of living, then you know that things will not change as they currently are and you will not be able to afford that 'thing' you desire however long you work.
In the second situation, the opportunity or hope that comes from gambling seems an adequate risk to achieve the money they want to buy the 'thing'. After all, occasionally their gamble will actually pay off and solve their problem temporarily.
Unfortunately, the downside / reality is that often is the case, the poor get poorer by wasting money on things like scratch cards.