system
Given the following post, respond as if you're commenting on Reddit:
human
[Star Trek III/IV] Why was the Enterprise 1701 being decommissioned in III only for a brand new exact same version of the ship ( 1701-A ) to be rolled out just a few months later in IV?

Has the Federation got nothing else to do but build starships?
gpt
The Enterprise-A wasn't originally meant to be the Enterprise-A. It was a gift *and a punishment* to Kirk for his actions with both the Genesis device and saving Earth/the Federation with his time travel antics. The ship itself was built as an entirely different vessel (beta canon says it was the USS Yorktown), which just happened to be conveniently undergoing major refits and upgrades much like the Enterprise a few years before. 

After Kirk returned to the 23rd century with the whales, the Federation was left in a pickle. On the one hand, the Klingon Empire had some legitimate grievances with Kirk and might have declared war if nothing was done. On the other hand, Kirk saved the heart of the Federation and robbed the Klingons of a potential doomsday weapon before that. So the Federation scrambled to shove Kirk was far away from politics and the spotlight as possible. It just so happened that this "punishment" happened to be exactly what makes Kirk happiest, and his crew was more than happy to join him. 

As you see in the following few months (Star Trek 5), the Enterprise-A was literally shoved out of spacedock as soon as the registry paint dried, so it had a TON of technical problems that Scotty needed to fix. Again, this just happened to be what made him happiest, so it worked out for everyone. 

But also, yes, as a multi-light-year spanning interstellar empire, the Federation has the capability to build a LOT of ships. Even in the 23rd century, they could churn out starships at an alarming rate if they needed to.