I don't think this has anything to do with greed. If it were, after losing a little here and there, a truly greedy person would stop gambling and walk away because this very greed would prevent him from losing any more. In other words, his greed would make him loathe gambling in a short while. I suspect we should rather talk here about gambling addiction, which is not particularly different from, for example, alcohol or drug addiction.
Does greed have anything to do with these?
I think you're wrong. A greedy person will not stop there because he is greedy. He would always want more than what he has. It's an insatiable hunger to more money. No matter how much money he has made, he will still gamble and the only way to stop that is to lose all of his wallet balance. Have you ever seen someone in a gambling site who won a lot but then continued to gamble and ended up losing all of his earning as well as his original bankroll.
I don't really see how you disprove my point. A greedy person will not stop if he is winning, not losing. Obviously, he would want more and more, but if he is losing it is clear as shit that gambling will leave him in rugs. If a person is hungry he will go where he can actually satiate his hunger. He will not stay where he is being starved and where he is being made even hungrier. Of course, if you first start winning, you will definitely look for more, but it is your wins that make you greedy, not your losses.
Your losses would discourage you from gambling if it was just about greed alone.