Not joining is almost not an option for a new state. Membership is the ultimate recognition of a new state, the big prize for nascent states like Kosovo, Palestine. read more
So really, to answer the question, the reason why some countries are not members of the UN is simply because they have not provided a legitimate and approved declaration of membership, for the most likely reason that they are considered illegitimate countries by UN members and thus do not receive the vote, or perhaps that the country has some sort of limited recognition, but not full membership. read more
With all the benefits to the EU you still find countries that do not want to join. I find that there are two types of countries which don't want to join the EU. The first types are nations that have substantially higher standards of living then the rest of the EU. read more