Op you are right. It is because they want to get rich overnight and they believe gambling will make that happen.
Gambling is not a short cut to get rich, the probability is very slim. Normally, whenever you feel like gambling, make sure you set a gambling limit. When you exceed that limit, stop immediately.
I will advice everyone to set limits in their gambling. It could be daily, weekly or monthly and make sure you adhere to it.