The thing is, companies actually have hundreds of different in-house libraries which they reuse when building games, even if they released the code they wouldn't release the code for those libraries so the code would not even compile. All the art, graphics and models wouldn't be released either since they can be reused somewhere else. And it would open people to build their own replacements for those libraries, eventually leading other companies to pick and release these games for their own profits (since licenses like GNU would allow you to profit from them as long as the source code is available and changes are released, and the community already did all that).
I think it's best if they release an end of life patch where they remove mandatory server communication or disabled multiplayer so that only single player mode was available, added bots if multiplayer-only so that you can play it offline, or talking from a developer point of view, release the API specification so that a minimum server could be built to make the game playable again. However, again they might be using some shared API calls that might put other current games at risk.