How is it not gambling? You put in something you need to buy with money to receive an item you can trade for money. Sounds awfully similar to me like you go to a casino, get some chips to wager and then later trade the remaining chips back for money. Regardless of whether the "official" law states it's gambling or not from a moral perspective they are pretty much identical.
> to receive an item you can later trade for money.
A person could reasonably argue can be exchanged vs primarily intended as a stand in for cash is important. If the items are intended as actual items people value then that's more defensible than say chips that only exist to be cashed out. (And I'm not familiar enough to know whether that's the case here)
I would maybe agree with you if the marketplace were not operated by Valve. But it is. This makes very clear that the one of the intended use cases of the skins is to be sold. Which is understandable, it's very likely Valves makes in the order of a billion dollars just from the marketplace.