Being in the EU is of debatable value (I think it's overall a good thing but I understand that there is some bad). Being in the UN is basically a requirement for being a country in the modern world.
I don't disagree, but it seems to be something Cameron is rather keen to hang on to.