If you do anything while you are lonely then it will become your habit since your mind is very eager to do something so if you gamble while your are lonely then it will become and addiction.The other reason is that greediness people just want to be a rich person in very short time and they think the gambling can do that for them but actually they are going to lose their money here so they will keep chasing the money and will get addicted.
I think you meant we're going to come back to gambling whenever we're sad in order to cope up with the loneliness. It really depends on your situation and how can you handle it. Do you get lonely whenever you're alone because of this problem? Then you sure will be gambling a lot. But, are you the type of person that only gets lonely sometimes? Then even when you have gambling as a way to cope with it, you wouldn't be gambling much since you're seldom lonely.
Another thing that we can put into consideration is our ability to solve the problem. If we are able to get rid of the problem, we have no more reason to be lonely, thus, no more reason to gamble. It really depends on a lot of things but the ending will always be you actually solving the problem.
I think it's true tbh. People who don't have any hobby, have so much free time in his life, don't have anything to do and lonely, all are makes people do gambling and sometimes become addicted to gambling because they don't have anything to do beside do gambling.
Sometimes we're not really addicted to something. It's just that we don't have anything else to do. Before, I used to think that I have a drinking problem because I'm going out a lot with my friends we used to drink almost every day. When I put some thought to it, we all don't have anything else to do with each other. We like different things and we all have different hobbies. Basically we're bonded by the alcohol. At some point, I stopped coming just to see if I actually had a problem. Turns out, I don't. I used the time I would spend drinking (which I thought was my addiction) doing something else like taking photos and editing them. I didn't even feel the need to drink at all. The addiction was nothing but an illusion and I was able to give it up right away by just filling the time with something else.