Besides second order stuff like that it might help some Steam Deck sales (mostly by demonstrating their commitment to the platform and attract other companies to develop for it, moreso than anybody rushing out to buy a Steam Deck specifically to play Half-Life), the fact that Valve does stuff like this that's not directly "make all the money right this second"-driven is in no small part why Valve has such goodwill with the PC gaming community.
In theory, it's not that hard to compete with Steam. Valve's cut of game sales is massive, and a competitor could easily slash into that to undercut them. Which is what Epic Games is trying to do. Yet, Valve maintains an extremely dominant market condition largely predicated on that goodwill.
And, of course, exactly because of that dominant market condition, they've got all the money they could possibly want to burn on random vanity projects.