Yes of course can give you a lot of lessons in life, in terms of financial losses that can teach you how to value money in a matter of time. Because thar time you are engaged in gambling is you are not thinking to earn money for your family and the only thing you aim is to win and not lossing. If we generally analyze the whole idea here, you didn't expect to loss and yet you really loss because gambling always make's you loss rathen than winning. Having a bigger lossea that cannot be recovered by playing again will certainly give you a nice lessons that will also give you the principle of not joining gambling bets anymore; life will be change as well.
I think it can, good lessons in life can be learned in a hard way. If you have lost a lot in gambling, maybe it can teach you how to control greed or to set aside emotions when making decisions. Sometimes when you gamble and you've lost a lot already, you wouldn't care if you will lose more.