Then you ought be a bit more careful saying "member states shouldn't be allowed to leave..."
Member states should be allowed to leave for any reason or no reason at all.
No state should be allowed to do ANYTHING on the basis of a crude non-binding simple majority opinion poll. Because that really is 'no reason at all', and making massive and unpredictable changes for no reason at all is batshit insane.
In a representative democracy, the sovereign body that governs a state shouldn't be subordinate and beholden to crude opinion polling. Any holder of the executive power (be it a monarch, Prime Minister, or President) who attempts to subordinate a sovereign parliament on the basis of a such a poll, is engaging in a coup d'état.