I agree that there is an element of risk in both trading and gambling but trading is controlled by you, I mean you can buy asset today and you can sell it off tomorrow if you see the market is going unfavorable to you but in gambling you are firstly pushing your luck against a constant negative edge known as house edge and secondly you cannot make decisions, the results are generated immediately so no way you can manage your loss.
Trading in indeed based on probability but that at the same time you are the one who can analyse market and make the best trades while gambling you can't do any analysis unless it is sports betting which comes with a 15-20% house edge.