I think aerodynamics (both lift to weight and streamlining) are the reason for the compact design of aircraft and submarines (also perhaps reducing the profile for military vehicles).
Weight maybe an issue for maneuvering in combat, but there's tons of structural material literally floating around in space, so I'd wager that base material cost would not a limiting constraint.
You probably would have boxy starships for the same reason you have boxy houses: more usable space. The same arguments apply for spherish houses, but those never caught on. Given the distance that the starship is going to travel, the main cost is probably not the materials so much as the time, so you'd want to maximize the amount of stuff you could ship back and forth.