Seeing as the world is now so global & every country knows about a lot of other countries, why do we not become a United Empire of Earth & have one government? I don't think there'd really be many problems with that seeing as we all sort of see the United Nations as the world's parliament. What could go wrong? In fact, a United Empire of Earth might govern better because literally, the whole world would be watching. Necessary infrastructure would be put where it needs to be, laws could be made to prevent certain groups of people gaining more influence than they should. Of course, some regions might become much richer than others but no one would need a passport, a simple plane ticket would be enough for you to travel & live anywhere in the world.
I think the problem would be that some prejudices would start to sink in & some might want to put their countrymen first. If a Chinese person is put in charge of Japanese matters, how would the Japanese feel? In a way, the world already is like a United Federation because of globalism. Just 300 years ago, there was no telephone, radio, TV & internet so there was little chance of a common person anywhere in the world to know people from far-flung places. Today, you're ever more likely to know someone on the opposite side of the planet from where you are. So, we are almost already one big country as citizens of the planet Earth today. In our daily lives, we're increasingly more influenced by foreign countries which was never the case. Would a United Empire of Earth last or would we be doomed to go the way of Babylon when our prejudices get the better of us?
A country is essentially defined by language more than ethnicity because when there was nothing to help us translate, you couldn't speak to someone who didn't speak your language so simply couldn't be countrymen & hence you'll find countries that speak one language are older (or have an older history) than countries that speak many languages & countries that speak one language often last longer than countries that speak many languages. The very word izwe meaning "land"/"country"/"world" has a common root with the word izwi ("voice") to indicate that a country is more formed by a language than anything else. Cultures & customs may cause a federalism to exist in that country even if it speaks one language but ultimately the reason countries exist is usually because of one state language. If the world would be one country, it would need a single language or - at least - language unity.