While playing it feels timeless and there are no worries.
Once the cash is gone the worries and feelings return most then say why did I do this.
Indeed, it can work as a defense mechanism. I am not an expert in psychoanalysis, but I can tell you from my experience and what I have read/discussed, we need constant higher dopamine spikes. You lose interest in other fields of life because your base level of dopamine is getting higher, and you have now become accustomed to using gambling as stimulas to get higher levels of dopamine.
In poker/sports betting, you need to focus on learning and research to get enjoyment, and your sense of achievement must come from something you have learnt through training and self-discipline. If you are in a constant delusion of getting your sense of achievement from hitting 1000x on slots believe me you will need 10000x next time, and even 100000x.