There is a ton of external wiring and plumbing connecting modules, so it isn't as easy as undocking one. Think about all the power and cooling connections that have to route to the truss, plus all the data lines between modules. The US segment and Russian segment are inextricably linked with all those external connections, and potentially even cold welded together at the mechanical interface.
The maintenance is piling up on old parts. One of the selling points of new stations is to dramatically reduce the part count. Imagine stocking dozens of types of fans, fasteners, pipe fittings, connectors, etc for a bunch of different heritage modules.
Companies building new stations don't want the old stuff. NASA asked them. Even cargo modules, like Leonardo, which is basically a can, aren't desirable. At some point (idk if this is still true) Axiom was going to get the Raffaello cargo module out of storage on the ground to convert and reuse it, but that's all I'm aware of.