The United Nations is a coordinated effort that tries to and should include all nations. Excluding a nation based on their choice of a political system is unfair to that nation and its citizens and puts undue pressure on a sovereign nation to change their political system in order to participate in global politics.
There are two reasons for this. First the easy one. If you do it the other way, and only democracies can vote, who determines which countries that applied to? Is the UK out due to having a monarch? Is the USA out due to gerrymandering? There could be a lot of pain while those definitions get sorted out. Next, the hard reason. Allowing non-democracies to vote gives them a taste of the democratic process. This taste of freedom and exposure on the world stage will over time move almost any country towards freedom. Our goal.