Yes, I have seen many gamblers donate to others after winning and their mentality becomes very happy. An exciting win that is accompanied by a desired goal another smile and a small loss dulls the pain and entices them to gamble more. You may lose temporarily or suffer more from the pain of losing money but sometimes the joy of winning can overcome all the pain. The joy you get in generosity you may get in anything else and through mutual exchange and giving money to the poor. It also happens that before I get involved in any bet I donate some amount to the poor as a form of generosity to get the grace of God and this sometimes helps in determining good luck. While gambling or gambling besides being happy with luck you can also keep yourself mentally cheerful by entertaining yourself and by donating.
When a player gives something to others or shares a small part of the winnings, he automatically makes himself even happier.
Or, such people share winnings because they think they have made a good deed, a now universe must repay them with something positive. Like in ancient times give or leave rewards to statues, that suppose to represent gods, as an act of thank for help or success. With a thought that next time gods should help them again. Identically people share gambling winnings, because they expect to have a huge win again. Not always people share winnings because they want to share their happiness, sometimes they try to pay philosophical luck tax.