For an "on the third hand" argument (this is, after all, both Star Trek and Halloween Hangover), it is a prominent feature in the Trek universe that certain starship designs are in common use across cultural borders. Officially, this sort of begins with "Heart of Glory" where the only way to tell a certain freighter for a Talarian vessel is to wait for her pennant paint to become visible. Anybody with a brush and some vacuum-proof paint could thus engage in "false flag" piracy - and anybody who ever navigated the spacelanes would know of the risk of such things, and be wary of approaching ships, even if these flew the Starfleet flag.
The way I see it, there are certain companies/governments that manufacture a bunch of ships that a whole lot of other groups buy from. It would make sense that you'd buy ships from someone with better or more efficient tech than you, unless there were serious security concerns (which probably wouldn't be an issue unless you were buying from Binars, or Romulans or the like). We know that there are arms dealers dealing with governments - that's how Quark's cousin got his moon, after all. If everyone made their own stuff, he'd be out of a job, or at least not be near as lucrative, only selling to relatively small pirate and merc groups. Plus, standardization means cheaper and more available maintenance, which would be important for freighters going all over several quadrants.