Yes, but for shipyards located in other star systems (without significant local populations), you're shipping the parts for the shipyard, the workers to build the shipyard, the workers to man the shipyard, the parts that are assembled at the shipyard, and the guards to protect the ships and the yard against raiders.
Yes - that is one simplistic example. There are lots of variations...
Why ship the parts and manpower to build the shipyard - just ship the shipyard and leave it. (Why? - strategic location, resources, politics and treaties, prejudices, keeping shipyards out of your own system, wars, intended colonization, etc.) Totally aside from transients, etc. populations are not static. Two year, two hundred years, before a survey, the system may have been booming for any number of reasons and therefore have a nice, high capacity shipyard. It may also be booming two months after the survey.
As for 'guarding' a station - that is certainly subject to automation, much more so than even construction (and not any fancy AI, either, as internally reactive would work well enough vs externally pro-active). Besides, if the RW is anything to go by, if the station is largely just a dormant construction facility it is unlikely to be protected by anything other than locks, signs and a gate.
Nothing in Traveller that I know of says shipyards are exclusively commercial. Especially as part of the starport, they, by and large, are going to subsidized, built or supported by government, at least initially. Most RL facilities - plane and shipping - are. As a critical part of interstellar trade, they will be subject to both private and government
long-term investment, with collateral profit interests.
Coming up with rationales to match any possible UWP is really not that hard (though plausible physical ones ala tiny worlds with too much atmo can be a stretch). 'Making sense' in a larger setting like the OTU is another story entirely. I get that this is a major pet peeve. However, when looked at from a 'playable' standpoint, if the frequencies of occurrence where more believable for the entire OTU, then the odds of Players actually encountering
interesting parts of it get pretty low. Either way, the OTU is what it is. I'd rather random worldgen generate interesting scenarios that I can dull down - its a more useful tool that way. I don't need a system designed to believably create 30,000 worlds.
Rather than simply complain about it, I'll offer up 'solutions' in the form of rationals. For rules, I never liked the Pop as 2D6-2, switched to 3D6-3 with modifiers for atmo a long time ago. I also interpret Pop-0 as ranging from 'Unknown' to 9. The former is good for ATUs, the later may be usable in the OTU.