Releasing a game's source code allows it to be read, forked, and modded. It increases enthusiasm for the game/franchise.
What do games studios gain by not making source code for old games (when available) public?
The example I had in mind was Westwood who haven't released Red Alert 2 source code. (but the same question applies to any game studio / game).
Doom's source code was released and it had an vast impact on modding and enthusiasm for the game and its creators.
Why isn't it more common for studios to release source code for old games?
1) they may not even have it. The source code for lots of classic games have been lost. By some estimates at much as 90% of pre-2000 source code is gone. https://arstechnica.com/gaming/2021/01/saving-video-gamings-...
2) the game may use code from other companies or libraries or something that they don't own.
3) it might even be unclear who actually owns the source code now.
4) it isn't worth the time to get things straightened out. Nightdive studios tried to rerelease No One Lives Forever and the companies that might possibly own the game hadn't digitized the contracts and either weren't interested in the hassle or wanted Nightdive to pay them to take the time to look and promised to refund them if they didn't. https://kotaku.com/the-sad-story-behind-a-dead-pc-game-that-...