what really leads to this is greed or lack of discipline?
I think that it's usually the lack of understanding. People fail to understand that there's nothing certain in gambling (excepting that the house always wins - sooner or later). People think that they can earn money from gambling (i.e. sure wins)
I've seen so many people coming with ideas and strategies how to beat this or that gambling site...
And, whether one tells it or not, I expect that the gambler thinks that he has "understood how it works". Maybe he even got some nice win once. Maybe he had a bit of profit many times. And got to get used to that.
Then got unlucky and lost all. From that moment on, he will try to recover the loss. He doesn't understand that he will make it worse. And worse...
And the body doesn't help at all. Because the adrenaline and endorphins are made in large quantities even if one is losing.
If one understand that gambling is for fun, if one understands that it's something to play with money he affords to lose, then he can have fun now and then. Of course, the adrenaline comes when bigger amounts are gambled, hence us, the poorer ones, have to do it less often (so we put away a bit more money) if we want it to be good.
It's not greed. But it's clearly lack of discipline. After a certain level is met, you don't have to have at hand more money than you should gamble.