Live service games are closer to social media, IMO - they're a version of Twitter/FB with better graphics and things to do, and as you say that can't be turned into a static product.
There are plenty of folks trying to reverse engineer the protocols used for older live gaming environments - for example the Dreamcast/Gamecube Phantasy Star Online has a fan-run server here: https://schtserv.com/ , but that's the exception, not the rule.
When internet infrastructure was much less advanced, the server application used to be part of the delivered product so you could host it yourself at a LAN party.
I understand that packaging, documenting and supporting an additional application is a cost that the company would rather avoid if possible. But upon shutting down a game's servers, it would cost them nothing to provide the discontinued app code "as is" with no warranty or support, to let fans figure out how to run or improve it themselves. I doubt most game companies have any incredibly valuable and cutting-edge networking code worth protecting.
Middleware with limited licenses is also a problem the developer chose. If there was a legal requirement to publish the code (source code escrow should be required for copyright to be enforceable IMO) then developers would take care not to fall into that trap.
There are plenty of folks trying to reverse engineer the protocols used for older live gaming environments - for example the Dreamcast/Gamecube Phantasy Star Online has a fan-run server here: https://schtserv.com/ , but that's the exception, not the rule.