I suspect it's because of paid DLC. The ol' razor and blades model - give the game away for free and reap the profit on bought game content (e.g. 'hats'). The margins on those make gillette envious.
Regardless, as people said the sales of TF2 have probably mostly dropped off, distributing the game for free costs nothing (well, it costs hosting and bandwidth but I don't suspect those costs make up any significant percentage of Steam's total costs, so effectively the hosting is free) so they have barely any income to lose and a massive fanbase and ingame transaction economy to gain.