And if you refer to crates of random items as gambling, they've also filled in that gap with the Steam Marketplace where you can buy individual items for market-dictated prices from other Steam users, where Valve takes a portion of the money the items are sold for.
This business is extremely profitable. Looking at their game Dota 2 for example where they recently hosted the world's largest e-sports tournament, where the pricepool were completely funded by the players of Dota 2 through in-game virtual items. This pricepool were over $20,000,000 USD, funded through in-game purchases where 25% of the items price would go to the pricepool, and the rest would go to Valve. That is $60,000,000 USD that Valve profited in the span of two months, for one of their games, in one of their tournaments. Valve hosts 4 tournaments per year for this game.
Looking at the pricepool of their previous tournaments ( http://www.esportsearnings.com/tournaments ), we can see that this amount just keeps increasing year after year.