For some, at least those that care about such things, it also goes to reputation. They dont have to support an old game with updates or patches and such. Nor any new anti-cheat measures. That by itself isnt exactly cheap.
And here we have UT2K4 back. Going on 17 years old but Epic keeps the activation/master servers going anyway since UT has always been its prestige title in the companies history. Their state-of-the-art game engine is Unreal after all. Wouldnt make sense to stop spending a tiny amount of money, in a company that earns several billion a year, to shut its namesake off. Its not as though anyone actually buys the game anymore either. Steam still sells CoD4. Dunno about 5 but the writing has always been on the wall for 4 and the thought is that their shutdown of the master server was an attempt to kill the game that backfired.
Maybe in that particular case its because there is already a community run master server that would take its place if they did so. Albeit with an unofficial patch. Would make for an interesting story in the gaming press (or more so in social media) if the big bad corporation shut it down, over money, but players kept it going anyway on their own. Might suggest that for newer titles they really arent needed as much as they say they are.