"Palestine" most certainly elected Hamas.

According to international observers the elections in Gaza that Hamas won in 2007 were democratic and fair:

The National Democratic Institute (NDI) in partnership with The Carter Center reported "a professional and impartial performance of election officials".[33] The European Union delegation reported "there was nothing which would indicate that the final result was not the outcome chosen by the voters".[34] A CRS Report for Congress on the 2006 elections concluded: "The election was overseen by 17,268 domestic observers, complemented by 900 credentialed international monitors. ... The Bush Administration accepted the outcome of the Palestinian legislative elections and praised the PA for holding free and fair elections. ... The conduct of the election was widely considered to be free and fair."[45]

https://en.wikipedia.org/wiki/2006_Palestinian_legislative_e...

Indeed, the entity that did its best to obstruct the democratic protest was Israel:

In the lead-up to the elections, on 26 September 2005 Israel launched a campaign of arrests against PLC members. 450 members of Hamas were detained, mostly those involved in the 2006 PLC elections. The majority of them were kept in administrative detention for different periods.[23] In the election period, 15 PLC members were captured and held as prisoners.[24]

During the elections, the Israeli authorities banned the candidates from holding election campaigns inside Jerusalem. Rallies and public meetings were prohibited. The Jerusalem identity cards of some PLC members were also revoked.[25] The Carter Center, which monitored the elections, criticised the detentions of persons who "are guilty of nothing more than winning a parliamentary seat in an open and honest election".[26]

Israeli obstruction during the election resulted in estimated 123,000 voters in East Jerusalem being prevented from registering until ten days before the elections, creating a number of logistical problems shortly before the election day. The checkpoints of Israel also continued to pose serious obstacles to all Palestiniain parties during the electoral campaign as well as on voting day itself. It was also noted that Palestinian refugees in exile and 9,000 prisoners remained ineligible to vote.[27]

https://en.wikipedia.org/wiki/2006_Palestinian_legislative_e...

The only problem with the elections was that the Palestinians elected the wrong party. The US, that great champion of liberal democracy around the world, did its utmost best to correct the result: they sponsored, armed and trained a Fatah faction to stage a coup; which backfired and left Hamas in control of Gaza.

The report said that instead of driving its enemies out of power, the US-backed Fatah fighters inadvertently provoked Hamas to seize total control of the Gaza Strip in June 2007. David Wurmser, who resigned as Vice President Dick Cheney's chief Middle East adviser a month after the Hamas takeover, said he believed that Hamas had no intention of taking over the Gaza Strip until Fatah forced its hand. "It looks to me that what happened wasn't so much a coup by Hamas but an attempted coup by Fatah that was preempted before it could happen," he was quoted as saying. Wurmser said that the Bush administration engaged in a "dirty war in an effort to provide a corrupt dictatorship [led by Palestinian Authority President Mahmoud Abbas] with victory." Wurmser said he was especially galled by the Bush administration's hypocrisy. "There is a stunning disconnect between the president's call for Middle East democracy and this policy," he said. "It directly contradicts it.".[69]

https://en.wikipedia.org/wiki/2006_Palestinian_legislative_e...