I'd be wary of the Star Trek
future in which the whole Earth falls under one government. It's apparently a prerequisite for us to found the Federation, in which every planet counts as one member (but we're the big dog and don't forget it
). Even so, it has disadvantages.
A single government for the Earth would have so many citizens that it simply could not be responsive to them. We'd be ruled by distant elites who would not necessarily share our values and priorities (much like the European Union today, in the eyes of many of its people).
And those elites wouldn't need to be responsive. A government with six billion constituents would not have to answer to any of them. Assuming you even had an elected representative in the legislature, he would either be powerless because the legislature is so large, or he would have so many constituents that you would mean nothing to him.
The main problem with the EU is not so much different values and priorities, though that maybe part of it, it is that the elected officals have a disconnect with the electorate. Even in the some more pro-EU countries in recent years if there has been a referendum on an EU matter it has been rejected (not always). All this means is that the politicans didn't do a good enough job of explaining what benefits it would bring. Remember the EU grew out of a free-trade zone (i.e. economic community) most Europeans don't have an issue with it acting as a free-trade zone.
As for how the United Earth Government works in ST, we know virtually nothing about how it works. Though ENT hinted that it was a Parliamentary based system. For all we know there is a lot of devolved power to regions on Earth. Who handle the day to day matters, whilst the United Earth Government handles intersteallar matters for the most part.