This happens because, in my opinion, they believe that every gamble will result in a profit, so even if they have lost, as you said, once they have enough money, they will most likely return to gambling and bet their money again. The bad thing is that they may obtain that money from illicit sources.
This really comes down to self-control. If someone has good self-control, whether they are wealthy or not, they are unlikely to withdraw the profits they have already earned. The opposite is also possible.
The possible chance of illicit acquisition of money in this narrative may be low. Provided they work and the source of income comes in, they'll be one option alone; working hard. The players who go out of their way to commit crime for gambling barely have something doing to earn money. A busy mind doesn't think of illegal actions, but like I said earlier, the chance is low, greedy gamers will always get disappointed.
I have always thought that when an individual or a gambler has a job, a good paying job, the attention on gambling is reduced. He won't be investing all his time and attention on gambling just like an unemployed person would.
I find it rather strange that a person would live his life working hard so he could raise money to gamble. We can imagine what would become to such a gambler if he eventually loses his job, he would not be different from those other gamblers who would do anything just to gamble. We can already see the signs in him that gambling is one of his greatest motivations; if there are no jobs, he will still be motivated to gamble anyways.