i believe that if you invest the same way you gamble you will lose there too. so it is not about the gambling that you lost in this case but instead it was your mistake. you should have withdrawn the winning profit and continued betting with the remainder of your money not with the profit.
the same thing is also true about trading, if you get greedy and keep holding your altcoins for example even after the price rise, it will some come down and you lose money.
Besides, investments and gambling isn't really that much of a difference except investments take quite a long time to see whether you lose or you gain profits. In gambling, it's a fast pace and you get to see the results faster.