They warned the gambling sites plenty of times. They tried legal action several times. Those sites were against valves ToS.
I don't think they tried very hard to shut them down, they could be doing a lot more.
Edit: based on what I recall from this Coffeezilla video (https://youtu.be/13eiDhuvM6Y?si=GJ_kXOJyXFTogy40&t=476)