That isn't anything to do with valve though is it.
The CS Go gambling thing was being done off-site by a 3rd party, Gabe Newell/Valve were never involved. I have no idea what about TF2 you are relating to because that's an ancient game and you provide no context. And dota loot boxes are also nothing to do with valve
The point is that the entire system of 'crate that needs to be unlocked with a key for a random reward' is in itself already a form of gambling, especially as the various rewards have a value through the steam marketplace.
The paid loot boxes and skins with actual cash value that are integrated into CSGO and TF2. You can gamble inside the game without any third party tools and get your cashout as steam wallet funds or use a third party website to cash out for money.
So without the third party websites which valve warns users not to use, you put money into the valve eco system and it never leaves and this is gambling? Ive lived in Utah, one of the most puritanical states. They banned all gambling. Yet I could go down to a bar, play some poker, and come out with my winnings in the form of vouchers for the same bar. If even the Mormoms don't consider that gambling then neither do I