Gambling and trading are not the same thing, although both have to do with prediction. In gambling, you are not always certain what the outcome will be; if the outcome is as you predicted, it's your good day of luck, but in trading, if you handle it as if it were also gambling, what you will likely experience is more loss. A gambler can be reckless, and they end up losing more often. If such reckless gambling methods are being practiced by a gambler, sure, there will be more losses, but if you trade with caution, acquire all the necessary education about trading, and develop some trading strategies that work best for you, you will make more frequent profits in trading than in gambling. The only thing is that in gambling, you can get a huge win abruptly, but before then, you have experienced countless losses too.
Well, let me analyze this in this way a trader can be a good gambler while a gambler may not be a good trader.
Now you will be wondering how this is possible. Well, trading teaches you a lot of things and one of the major tools that you get with trading is to control your loss (through Stoploss or other means). Trading teaches you money management also. So when a trader will gamble, he will use that experience of him and may not lose more money.
Yes, the outcome of the gambling will be luck based, and the trader will have no edge on the result of gambling but the trader will be more concerned about the amount of money to play each game, to calculate the loss and the profits, the risk and the rewards when taking the sports bets and all such stuff. That is why a good trader can be a good gambler too.