Democracy is not the same thing as liberty. Freedom comes only from the recognition of individual's rights to life, liberty, and property. If the majority in a democracy can vote to strip you of these rights, you are not free. If the majority in a society can vote to install a dictatorship, the society is not free - not only after the dictatorship is installed, but before the vote as well. If your rights are open to be voted upon, you are not free.
Applying this to a current event, if the Palestinians have voted to install Hamas as their leaders, the Palestinians are not free. Only when the Palestinians respect the rights of individuals in their own society and the rights of individuals outside their society, will the Palestinians be free.
Dictatorships are not legitimate sovereign governments.