It's sort of like asking why are Time Lords from Doctor Who so British. The obvious answer is that T.V. shows generally reflect the sensibilities of the country that produces it.
The Federation definitely has some similarities to the United States, but it could also be said to have more in common with the United Nations in general.
Earth = America
UFP = UN
Kirk = JFK
From there you could go into all the Cold War analogies of how the Klingons are the Russians etc, but it was never all that direct and has changed a lot over time, so that the Klingons are now also Vikings, Spartans, Samurai and charming space pirates, which of course is good. Lockstep metaphors are boring and klunky. Mixing it up is more fun.
The Cold War metaphors are just a starting point. The great thing about Star Trek is how the mythos can be added to over time, ideally without too much distruption to continuity. And that brings us around to Canon Wars...