Mahmoud Abbas should leave power based on democracy. But he is in power by support from Israel and US.
Why do not US and Israel support democracy in Palestine?
Politics Stack Exchange is a question and answer site for people interested in governments, policies, and political processes. It only takes a minute to sign up.Sign up to join this community
The premise of your question is incorrect. The current Hamas regime in Gaza was not democratically elected. Hamas took power in Gaza in 2007 after purging political dissidents and expelling Fatah, the opposition party. The Israeli blockade only started after Hamas' takeover of Gaza.
You're also not correct that Abbas does not have popular support. Though he has, in an undemocratic manner, unilaterally extended his term of office, the most recent approval polls I could find indicate that he has a 58% approval rating. In an actual democracy, elections would be held to determine whether Abbas should continue to stay in office, but the Palestinians failing to hold elections does not constitute a lack of respect for democracy on the part of the US or Israel.
That said, you can see DVK's answer for a list of reasons why the US and Israel would be more inclined to support Abbas over Hamas, even if that were not democratic.
The USA is - like most countries - mostly concerned with their own security. Yes, they like to appear as being champions of freedom and democracy; but have a rather long record of supporting right-wing dictators, overthrowing democratically elected left-wing politicians, initiating coups, and helping squelch uprising against dictators.
In short, the USA is very for democracy in other countries, but only as long as the people chooses "right" - ie. chooses the candidate the USA support.
Take the "Arab Spring"... The USA supported fights for democracy in some countries, but not (for long) in Egypt - of course in Egypt, the "dictator" was a strong supporter of USA and also somewhat a supporter of USA's allay Israel.
You've right, Hamas won the Palestinan election, but Fatha refused to relinquish power... and as the USA felt the Palestinan people had voted "wrong", they ignored the election and supported Fatha. IMHO Israel had it self to thank for Hamas election-victory, as they refused to give Fatha, PLO and Arafath any real victories - which of course eroded the Palestinan people's trust in Fathah.
@Baard's Kopperud's answer is mostly correct. Countries generally act in their own self interest, and only secondary based on ideology.
So, let's see what Israel's choices are:
Mahmoud Abbas and Fatah.
At least nominally, renounced terrorism (not really that simple, but details are outside the scope of the question).
At least nominally, claim - in English - to support Israel's right to exist.
 - Palestinian national charter still (despite Clinton and Arafat's English-only statements to the contrary) contains the goals of destruction of Israel (articles 19, 20, 21, 22). I covered it in detail in my answer on Skeptics here, the exact quote of #19 for example is: "The partition of Palestine in 1947 and the establishment of Israel is null and void from the very beginning, whatever time has elapsed because it was done contrary to the wish of the people of Palestine and their national right to their homeland and contradicts with the principles embodied in the charter of the UN, the first of which is the right of self- determination
 - there are entire websites like Palestinian Media Watch filled with numerous examples of PA government - via media, school books and the government people - denying Israel's right to exist
Is at its core a terrorist organization, fully officially supporting terrorist attacks on civilians, perpetrating rocket attacks on cities, and kidnappings as political tools
More importantly, fully and openly committed to destroying Israel and throwing all Jews into the sea.
Given these choices, simple common sense and self-preservarion dictates opposing Hamas and supporting Fatah.
As far as support for democracy: Hitler was sorta-kinda democratically elected too (ok, that's an oversimplification) and had an overwhelming support of German populace while in power. Doesn't seem to generate any desperately curious queries why USA or Great Britain opposed him.
Going outside politics, in a more ethical/moral realm: Democracy and self determination for a nation is akin to personal freedom for an individual. But said freedom does not exist in abstract, outside of the consequences of one's choices and action. Your question is akin to asking: "If you support an individual's freedom, why do you support putting criminals in jail?". Because they chose to abuse their freedom in ways detrimental to you/society. If Palestinian people choose to democratically elect a terrorist organization whose main goal is destruction of Israel, their choice gets ignored.