Every ship that's been turned into a museum has been done so (I think) through public support and private investors who have more or less bought the ship from the Navy. The Navy really doesn't have anything more to do with a ship once its decommissioned, no matter what its history. If the real USS Enterprise is to be spared from the breakers after she's retired, it's going to cost a lot.
Otherwise, she's worth a lot more to the Navy as spare parts and scrap metal that can be used in the construction of future ships.
But in regards to the "20-years old" reference in Star Trek III (aside from the real world reason), that could be a reference to how long it's been since the Enterprise's last major refit in Star Trek I. As an off-the-cuff remark, Fleet Admiral Morrow could be simply rounding off 15 or so years as 20. In any event, it could also be that the design itself isn't 20 years old, but that it's onboard technology is.
For Starfleet, it might be easier just to retire the Constitution-class and go with a new starship design than try to keep an old design up and running with new technology it might be incompatible with anyway.
Free your mind, and the rest will follow.