it feels immoral to build shipyard capacity that you won't even use on a recurring basis. but between tech level 2 and 6 (ish), yards go from being very expensive to very cheap, relative to the fleets they produce. building 6 yards that you will literally never use to guarantee you will have one yard right where you want it in a crisis, generally worth it for bigger/ more advanced polities.
Yes, exactly. Smaller races would have to divert a disproportionate share of their income to develop these capabilities, but for the majors, it will be seen as a sound investment in offensive expeditionary capability. For example, the Alliance, based on its recent experiences, wants an expeditionary support squadron available in several different locations across their territory to support fleet operations. Probably one per sector (they have three), plus extras at the home worlds. Each expeditionary support squadron would have some repair ships equipped with machine shops, which are smaller than shipyards, and less capable, but can perform repairs and unbox fighters as replacements. There would also be freighters carrying boxed fighters, supply ships with stored maintenance supplies, and ammunition ships with magazine reloads. All of these would give an Alliance fleet unparalleled capabilities in sustaining long range operations, unmatched by any race in the game. Just how many of each kind of ship there would be in each squadron is open to debate, and dependent on the time and resources the Alliance wants to sink into the project.
The problem is, shipyard ships, or even machine shop ships, tend to get pulled into other operations. For instance, machine shops can be used to refit existing units, and when refit time comes around, it can be very tempting to pull those ships off-station to support the nation's efforts to refit their bases and ships. This is a reasonable use of existing resources, especially in peace time, but if something kicks off unexpectedly, that means that those machine shop ships might not be where they are needed. This happened to the Alliance. They had several squadrons of machine shop ships and mobile shipyards, for supporting fleet operations, but when the need to fortify the Zir Villiers system came up they all got sucked into that mission, and then were retasked from that to begin refitting the 6th Fleet's ships. When first the D'Bringi, and then the Lothari and Aurarii troubles kicked off, none of them were available to support operations, as they were in a distant location beyond the frontier of the Alliance.