In the Star Trek universe, it is insane that all federation starfleet ships are not equipped with a cloaking device(no matter what problems they might have) as a last resort usage option. Especially, since Kirk acquired one from the Romulans in TOS "Enterprise Incident".
Well, that doesn't follow, since there's more than one kind of cloaking device. Look at all the separate times that cloaks have been penetrated but then a story set later depicted them as impenetrable. Daniels showed NX-01 how to penetrate Suliban cloaks, and it worked against the Romulan cloaks of the era as well, but then in TOS, cloaks were little-understood and impenetrable. The "Balance of Terror" cloak could be detected on motion sensors but the "Enterprise Incident" cloak couldn't. The Klingon cloak in ST III created a visible ripple effect, but later cloaks didn't. Spock figured out how to penetrate the Klingon cloak in ST VI, but in TNG Starfleet couldn't see through cloaks. (Also, the ST VI cloak could be fired through but TNG-era cloaks could not.) And so on.
The only logical conclusion is that cloaking devices are not a single technology, but a whole category of technologies. One kind of cloak comes along, gets penetrated, and is rendered useless, so another kind of cloak is developed and used until it gets penetrated, and so on. It's an ongoing race between stealth and detection, just as one would realistically expect.
So the fact that Starfleet once obtained a vintage-2268 cloak has no bearing on whether they'd have feasible cloaking technology in the 2370s or '80s. Heck, surely the Romulans would've been able to figure out how to penetrate their own cloaking tech, so that cloak was probably rendered obsolete as soon as it was stolen. It's likely that the intent of stealing the cloaking device was not so much so that Starfleet could use it as so that Starfleet could study it and figure out how to counter it. (And yes, the
Enterprise was able to cloak and evade the Romulans, but only for a matter of moments. I find it hard to believe the Romulans wouldn't know how to penetrate their own cloaking device, or wouldn't quickly figure it out once Starfleet stole it.)
And that could be why Starfleet ships don't have cloaks as "last-resort" measures: because they wouldn't do much good since the likely enemies would already know how to penetrate them.
Of course, if we really wanted to bring realism into it, then the whole idea of cloaking devices would have to be scuttled, since it's a thermodynamic impossibility. Every ship generates heat, and that heat has to be radiated out into space or the crew gets cooked. If you're in atmosphere or water, you have a mechanism to shunt the heat away quickly and blend in, but in the vacuum of space, any heat source is going to stick out like a sore thumb. The only way to rationalize cloaks in Trek is by assuming they somehow shunt a ship's waste heat into subspace or something. Which should still make them penetrable by a starship with subspace sensors.