Maybe like those who need money then the option they take is to gamble so they hope to be able to get a win that can make them happy with their win. When having financial problems in the real world then gambling is not an option to be a solution even though there is a chance to win but what must be known is the chance of losing is greater.
As you said playing with not to avoid problems in the real world.
Instead of being happy enjoying your gambling session it will bring more dissapointment and frustrations once you that real world problem was triggered, most of the time the way you think about your gambling activities has been change thinking that by playing you'll be able to forget your problem but in reality it added more especially in terms of controlling your emotions.
The level of excitement might be change to level of frustrations, best practice still is to have that set limitations that you are able to deal with can manage to follow each time you gamble.
I agree, gambling is indeed intended to seek pleasure, but try not to add to existing problems, keep thinking realistically and act responsibly. The money that is bet will not return in the form of a solution, so solve the problem in its place. Indeed, everyone has a tendency to avoid problems, and not a few people choose to gamble so they can forget the problem for a while.