A couple additional thoughts, ships age. Let’s take the oldest warship in commission, the USS CONSTITUTION. She has been rebuilt so many times, a case could be made that she is not really the original connie!
In our parlance, refits only give a +1 to a section, so computers gain a +1 refit, or Weapons gain a +1 refit. In actuality, ships cannot be continually refitted, or no new warships would every be built! When the original USS ENTERPRISE CVN-60, came into port for her first way overdue refit and refurb, much of her ducting was literally worn away, and only the insulation was left. It became a much more intense refit than anticipated. Old warships have to face the rigors of sea and wind, salt and storms…in space, there have to be allegorical threats to a ship, thereby aging it.
Powerplants, conduit, “wiring” etc all have a service life. All ships are built with an intended lifespan in mind. Take a WW2 Battleship and rip out the steam plan, and stick in a nuclear reactor, and put them back in commission as missile platforms. So many problems with this, not the least of which is cost. Yes, the old battle wagons would be virtually impervious to modern missiles (Let’s not get into the mission kill discussion) because of their armor. The bottom line I am getting at is cost. Yes, in Star Trek we have no currency, but honestly, everything has a cost, and continually refitting older warships is a loosing proposition because they continually get more expensive to maintain and keep up. The Batteship memorial in Texas, the USS TEXAS, floating at her permanent berth, started listing and was in danger of rolling over because her hull and fittings had finally rusted through.
No ships, like people, have lifetimes. They may be long an illustrious, but everything has a useful lifespan.