That's true, but military logistics has adapted to mitigate some of these costs.
> Parts become obsolete
There are two ways this is dealt with. The first is an activity called Diminishing Materials Suppliers (DMS). DMS is an ongoing support activity during production where the availability of parts is monitored and alternative parts are selected and evaluated if a manufacturer announces they are stopping or modifying production of a part for which they are the sole supplier.
The second is the lifetime buy. Near the end of a production run, and sometimes earlier, engineering figures out how many of a given part is needed to complete the full production run and provide spares for rework and repair. Purchasing then gets approval under the contract to purchase the entire quantity of materials and the stock goes to a warehouse until it's needed.
> engineers retire or move on
Knowledge transfer is one of the big reasons the defense industry is so big on systems engineering and mountains of documentation. Obviously that only goes so far, but generally there is less tribal knowledge within a DOD program than in most commercial engineering efforts.
> IT has to maintain archaic devices, operating systems, and tools
In general, IT doesn't go anywhere near the software and equipment used to program, test, and troubleshoot hardware and embedded software. Those pieces are owned by specific engineering teams on the program.