To be more precize:
As an ideal for a far future, when all states are free republics and mankind has solved its problems, sure.
But I wouldn't support a world government even in the far future, if it was to replace regional governments. Smaller entities can much better decide over issues that only concern them. But it wouldn't be bad if there was such a world government, only deciding over issues that concern the entire world, be that climate problems, large famines, natural disasters and such -- or contact with extraterrestrial aliens.
And there is something to collective security, if you ask me. You know, the principle the UN is based on already: A mutually binding alliance that makes sure collectively that single members don't start running amok. When one member state starts a war, the others can force it down with more moral authority than any single state ever can. And it can prevent disagreement between member states to escalate into war in the first place, by providing an institutionalized counseling and mediation system.
But such a system is only fully feasible when a large majority of member states is obliged to the ideals of freedom and republican government, not just on paper -- hence the flaws of the current UN system.
It would also require that people are mentally up to the task: Enough people need to view mankind as one united people, for that such a government enjoys enough support. Praised should be the person who doesn't love his nation, but the whole of mankind.
So if this ever happens, some day in the far future, it can be a good system. But at the moment, mankind is not ready for it yet.