That leaves resources, but planets have sufficient resources, and a planet like Earth, which is not a colony, is bound to have more industry on its surface than in space.
Why? Industry is polluting or otherwise disruptive to the environment. Moving heavy industry into space solves a ton of ecological problems. Solar power is more easily harnessed without an atmosphere in the way. Microgravity facilitates a lot of manufacturing processes (although it probably makes some harder). And the mineral resources that can be obtained from the asteroids are several orders of magnitude more abundant than what can be mined from the Earth's crust (most of Earth's minerals are trapped far too deep to reach), and are generally far more accessible and close to the surface. There are tons of advantages to putting industry in space rather than keeping it planetbound.
But you could also cite those as arguments for not building ships on a planet. Gravity is inconvenient; it exerts a constant force that can distort a structure's shape, and it promotes accidents. How many workplace fatalities are the result of people falling or things falling onto people? In microgravity, it's far easier to keep things in the desired position. Let go of a tool and it'll stay in easy reach rather than accelerating downward and quickly becoming a dangerous projectile. Two large structural pieces can be gently nudged into position without some massive framework or high-tension cables to hold them in place. Also, if a large structure is designed to operate in the absence of gravity, then assembling it in the presence of gravity could mean that once it's removed from that presence, its shape will distort and its structural strength could be compromised.The two best argument for building ships on a planet are gravity and air. Gravity means material won't just drift away if it's not tethered down, and in some ways that is very valuable, although a weak gravity like the Moon's is better (but there is dust and lack of air). Air means no need for space suits, and spacesuits make all manual tasks harder. A couple centuries from now a swarm of robots should be the work force which would eliminate most of the space suit issue, but if you have to use people, or if it's merely preferable, then it is preferable to use people in air, in gravity.
And air creates problems too. There are a number of manufacturing processes that need to be done in a vacuum -- microelectronics, optics, thin films, specialty materials, etc. It's important to prevent contamination by atmospheric gases or dust. Also, an oxygen environment creates a fire hazard.
Come to think of it, perhaps the best argument in favor of doing a long-term assembly process on the ground rather than in space is radiation. A worker's exposure to radiation is going to be far higher in orbit than it would be on the ground. Presumably a completed starship is going to have robust enough radiation shielding to protect the crew, but while it's under construction, the workers would be a lot more vulnerable. (Hey, I just realized that's actually a reason why the Search for Spock spacedock is a better idea than the TMP free-floating drydock.) And a deep planetary atmosphere is a better radiation shield than any deflector field. Still, there's the tradeoff with all the risks surface gravity creates.
Well, on reflection, I can actually buy that. After all, starships are designed to be able to withstand accelerations much higher than one g in just about any direction without suffering structural collapse. That can't be entirely the result of inertial damping fields, since redundancy is good engineering.On the other hand, the USS Vengeance sat on San Fran just fine as far as we could see in the movie. But, all that means is the Vengeance an do that. Also, it was built in space as far as we know, unlike the Enterprise.