To be blunt, a ununited United Earth in the Federation will not work. Period.
United Earth as an alliance of all the countries on Earth that are also still keeping their precious sovereignty to be independent nations like they do today under the United Nations will fail. The United Nations has not power. United Earth quite clearly does. Power that cannot be held by a political entity without the sovereignty of the nations that are part of it being given up to that larger political body. United Earth cannot afford to repeat the mistakes of humanity from the 18th to 21st centuries.
First one was the United States of America under the Articles of Confederation. It did not work, nor could it work in the long term due to the issues between the state (then still sovereign countries in an alliance for lack of a better term). Had it still been under that structure in 1812, the country would have likely fallen to the British, rather than barely hold on.
Second was the League of Nations, which had even less power to do anything than the United Nations, because several of the large powers on the planet never joined (the United States refused to join, even though it was the President of the United States, Wilson's idea.) It had no functional ability to maintain the peace.
The United Nations holds better because everyone joined it, but it is still not all that effective. The larger powers ignore it. The Cold War drew a line in the Security Council so that the UN couldn't really do anything. It does not have any power realistically to enforce policy.
The European Union suffers due to its nations not taking the step the Americans took when they cast off the Article of Confederation. They are semi-unified and protected realistically under NATO, which includes members that are not part of the EU at all.
United Earth, in dealing with multiple alien species that control large numbers of planets along with Earth having colonies and independent worlds with humans on them as well, could not function effectively without actually being united. United Earth has several unified exploration and defense structures. A combined diplomatic corp. These are things that a sovereign country would have to give up to join the larger political structure in order for it to have the power to represent Earth to planets like Vulcan, or Andoria ,or the Klingons. There is no functional way Earth could have managed the Romulan War if United Earth was not the sovereign power on the entire planet.
Sovereign if the big fear. The Americans don't want to give it up. The Europeans don't want to give it up. Thus the United Nations is a toothless dog. It has gotten worse lately as nationalism has started to come again. The US is making rumblings of wanting to kick the UN out of New York. The UK is trying to leave the EU. The EU is having problems with its poorer countries. The UN can't effectively do anything against the US or Russia, and never really could.