First of all, IMO the election of Hamas was a good thing. It meant the Palestinians could no longer play the Fatah good cop/Hamas bad cop routine. Now it is crystal clear the Palestinian people do not seek to co-exist with Israel, but destroy it. And Israel has had nearly free reign to deal with Hamas as a result.
Hezbollah is powerful not because it won 20 percent of the vote, but because of Syria's continued political influence over Lebanon. Take away Syria, and Hez would be a non-entity.
And Ahmadinejad was not elected in a fair and free election. If you believe he was, well, we really ain't on the same page of reality, and you must dwell in Pat's.
Also somewhat (albeit with some important differences) as you point out in the case of Hamas coming to power in "Palestine," the election of Ahmadinejad has contributed to a sharpening of moral clarity.
Even had that election been fair Ahmadinejad might still have won since the sizable pro-Democracy, anti-Mullahtocracy movement within the country had unequivocally repudiated Khatami and all other fake "moderates" like him, refusing to continue electing such, refusing to continue providing the mullahs the false cover of a "democratic" opposition, which in fact was in their full control all along.