They still do that, Valve popularized the concepts of battle passes (with Dota 2) and loot boxes (with Team Fortress 2). They also took a paid game with TF2 and added all that monetization after the fact.
Counter-Strike especially has a pretty nasty gambling scene that Valve refuses to control, even though its only possible because of their marketplace and APIs.
The only real in-game purchase in Counter-Strike is the game itself to gain access to the ranking system. The skins are a superfluous add-on.
They knowingly profit from gamblers if you will but gamblers are going to gamble.
The gamblers were offered e-sport or gambling and they chose the latter.
You could use Robinhood to build up a growth portfolio starting from a handful of dollars or you could use it to buy 0DTE OTM options on credit. Guess which one the gamblers chose.