I always assumed that the Federation was simply a United Nations writ large; each member state is largely left to its own internal machinations, with the caveat that it probably has to adhere to certain benchmarks for things like individual freedoms and whatnot. Starfleet should be a force maintained through mutual contribution from all the Federation's constituent members, like a UN Peacekeeping force, but with teeth.