This is a normal thing for very beginner to experience but as time goes on you would become more mature enough to know how to stop getting into precarious situations In gambling and also how to deal with losses. There's no lesson without mistakes, just like what you said, learning from our mistakes makes us more skilled. Skilled in the Sense that you know what to avoid and how to gamble smartly. Every gambler has learned a thing or two in their beginning phases.
Although we think most gamblers are learning from their mistakes that they made when gambling but I see they're not learning because you can see people making the same mistakes they made previously. You tell people not to gamble with desperation but you can still find many gamblers still doing that hence they're always losing and not making much progress. After trying the use of their last money to make money and they didn't succeed, you'll think that people won't do that again because they have tried it before and it didn't work but instead, you can still find many gamblers thinking that when they doubled their bet that they're going to make more money. Mistakes are constantly being repeated and people are still losing money instead of it being the opposite.