"Jim, the Enterprise is over 20 years old. We feel her time is over."
Why in the world would Starfleet value ships lasting if they can be replaced with technology as more members are integrated in to the Federation? A ship is a resource that can be replaced at any time. It's value is limited to that.
When that line was uttered, in universe the year was 2285, and the Enterprise NCC-1701 was launched in 2245, making it actually 40 years old. The Miranda and Excelsior Classes lasted at least 100 years, although that probably involved ships of the class being built over a long period of time and older ships being decommissioned. Using other specific ships as other examples (and staying to stuff that is in canon, even if some of it is from info on dedication plaques, etc), Sulu's Excelsior was in service from 2285-2320 (45 years), the USS Stargazer was in service from 2326 to 2355 (29 years), and the USS Leondegrance was in service from 2288 to 2336 (48 years). Some ships are obviously going to meet early ends just from various space events (ships named Enterprise have a bad habit of this), but its taken to ridiculous extremes in some of the newer shows.
Ships in Starfleet take literally years to build if they're the first or one of the first of their class (the galaxy class took about a decade, at least according to some sources), and even when everything is worked out and they have an "assembly line", for lack of a better term, we have no evidence that it doesn't take awhile to build a ship, with time probably varying depending on ship size, complexity and current resources. Earth lost Utopia Plantia shipyards too, with no evidence that it was rebuilt, which PIC seems to want to imply hurt ship availability, although admittedly the PIC writers seem to have forgotten that there are canonically many Federation shipyards, including another one literally orbiting Earth.
But ships obviously can't just be replaced at any time or considered that expendable. Losing 40ish ships at Wolf 359 screwed up at least a chunk of Starfleet's operations for awhile. The Dominion War certainly had Starfleet on the back foot trying to replace ships (and personnel). Even years after that we have things like the Titan-A using a bunch of parts from Riker's Titan, so replication of parts is either impossible or unfeasible for a bunch of components (if they were that easy to create then using older parts at all makes no sense), and we know the ships get built from the frame up because we've seen ships like that in shipyards a before so its not like they get replicated into existence, at least not actual starships (smaller things like shuttles could be a different matter). Plus PIC's era still uses ships like the Sovereign, Akira and steamrunner class, which even if the Akira and steamrunner were as new as the Sovereign in FC they would still be almost 30 years old by PIC Season 3, so some ships
The out of universe explanation for all of this is that the PIC producer/writer(s) just wanted to introduce a bunch of legacy ships while also keeping their legacy, so a bunch of inbetween vessels (Riker's Titan, the Voyager-A and Enterprise-F) got short life spans so that a shiny new version could be on the show. Which is fine, its easy to imagine those shops having very rough lives, but its still odd from an in universe perspective.