Let's differentiate "spacecraft" and "landing capsule".
There are various phases of the flight with various prerequisites, and several different (considerably different) designs of spacecrafts.
First, let's take the capsule. It must withstand violent reentry, unequal air pressures - the exposed side heats up enormously due to air friction, which is connected with quite huge pressure. It doesn't need to be lean and aerodynamic, quite opposite, it's one big airbrake with a passenger cabin attached to the trailing side. The pressure is largely unidirectional and primarily overheated, so the construction concerns of submarine are really distantly related, with its omnidirectional pressure, ability to withstand unexpected pressure waves (explosions), lean shape to minimize resistance, and ubiquitous water cooling making overheating non-issue.
Next, the orbital craft. To get there it must be be light. A mild kick could have pierced Apollo lunar module walls, ISS is more sturdy but still it's to withstand 1 bar pressure difference towards the outside (that's equivalent of mere 10m submersion depth), and again - towards the outside, that means no need for cross-beams to prevent buckling; it has natural tendency to bloat like a balloon. It isn't lean or aerodynamic in the least, air resistance is not a concern. Its construction problems are much closer to these of airplane hull than to that of a submarine.
And finally, the launch vehicle. This one does have to be lean, but again, it needs to be light. It is not resistant to lateral forces (its own acoustic wave reflected from the tower could damage it!), and again it doesn't have to withstand high outer pressures. The shuttle main fuel tank depends on internal fuel pressure; in other cases the structure is mostly unpressurized shell that allows air pressure to escape as it leaves the atmosphere, providing structural integrity but not isolating the inside - except for the relatively tiny human compartment.
Really, submarines with a considerable fraction of a meter thick solid metal shell, and designed for battle conditions - stealth, maneuverability, durability, weapons, aquatic environment - face entirely different construction challenges. On the other hand, there's much more overlap with airplanes.