That's right, there are many other good ways to entertain yourself if you feel sad and feel like you're alone in life. Yes, it hurts to be left behind but it doesn't mean the end of the world for you, you have to get up and move on because there are many other opportunities waiting for you. Don't ruin your life with gambling, there are many other things you can do besides that.
I think loneliness is the reason why people want to gamble, it's too kill our free time. But when you feel sad and feel alone in this life, that means you're not in a good condition, so could do something stupid or may harm yourself. To overcome this, one should try to deal with himself, try to find a good way to fill your energy. For an introvert can try to take me time, while for extrovert can try to meet with other people.
Loneliness is not as bad as you think to the extent of being suicidal, No, at least not in most cases. Those who would think of suicide must have had much more bothering their minds more than mere loneliness, and if anyone is in that category, they should immediately rethink of being alone so that it will not allow depression to make them act irrationally. Back to the context properly, loneliness can cause a whole lot but mostly triggers addiction in people because what they will always think about is what they love doing most. And if gambling is what the person loves to do mostly, that is what it would trigger out. There is no antidote to this unless the person changes the narrative.
If you know that you are lonely too much and too idle for anything positive in your life, you had better find other hobbies or try to hang out more often, there is no other alternative to that. This applies to introverts, extroverts, and even ambiverts, they all need to avoid the cause of loneliness especially if the addiction or the thought of it is becoming unbearable or dangerous enough that further affects the mental state of the person. If possible, thinking about other hobbies that are more productive is good and will not add negatively to your life but counter the bad thoughts. By doing this, I know the person can effectively counter the bad effects of loneliness over time.