Except you need blades to shave -- most hats have no effect on gameplay.
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.