Hamas did win elections, the one time they were held, but it won a large plurality, not a majority. Also, their charter does not state their goal to be the destruction of the State of Israel, but instead the extermination of all Jews and the establishment of a holy dictatorship, first in the Levant and then across the rest of the world.