People like that need to go rehabilitation. It is simple, one sees the gains and losses. If you spend more than you have, you need to quit and STOP visit gambling sites or similar. Why people like lose tons of money for anything

There are gamblers that are addicted with it even they have went in rehabilitation, it helped for a short time to resolve their gambling problem. But after a couple or several months they are keep on coming back again. But there are some successful gamblers that has been rehabilitated and overcome and succeed in resolving their problem.
You are right, there's no assurance that even though you have been rehabilitated for a time you can fully eliminate your gambling addiction problem. It still needs one to be discipline enough to follow the treatment method and one thing that's important is do not do anything related to gambling anymore.