I analogize gambling money as a hot asset, not a dirty asset, several times I make a profit, always losing half more than nominal profit. This is because of my thinking to continue to double the nominal without limits. When I decided to divide half of it to donate to those in need, it worked very well to stop the desire and greed to be more controlled.
That's a good way for you because not all gamblers will donate their profits and I have seen many cases like this, even those who don't donate the huge profits they get from gambling but they still have good control not to be greedy. So in this case each player will indeed have his own way to control greed and whether or not to donate it depends on someone's personal to do it.