I think segregation is more healthy for humanity as a whole, expecting a 1 size fits all system wont work for everyone.
Countries and borders are a good things, having different societies is inevitable, there is no real way to make all people integrate in some idealistic pan humanist society.
In fact i would HATE a pan humanist society as to me it sounds like a unipolar dictatorial empire with forced participation, which assumes a totalitarian planet, as by definition if groups of people dont participate then its not truly a 'pan humanistic' society but more similar to what we have now with different political climates with different borders, and if thats good enough, then we have that already but just in the form of countries instead of the whole planet.
In conclusion i think that multiple states with their own cultures and identity is the best direction for humanity.