Iran is not a backer of Hamas. Hamas is an offshoot of the Muslim Brotherhood. Their closest sponsors are Qatar and Turkey. They have a bad relation with the current Egyptian leadership, since the current military led Egyptian government got back into power after kicking the Muslim Brotherhood government there out. The Muslim Brotherhood got into power in Egypt after US pressure into holding elections after the "Arab Spring". US President Obama was basically responsible for the Muslim Brotherhood getting into power in Egypt.
Israel themselves initially fostered the growth of Hamas to split the Palestinian leadership and weaken the PLO.
In the Syrian "civil war" Hezbollah, a Shia militia, was backing the Syrian government while Hamas, which is Suni, was on the side of the rebels against the government. Hamas fighters in Syria were flown into Israeli hospitals to be treated. The conflict in Syria basically pitted on one side the Syrian government, Iran, Hezbollah, Russia, against the Syrian rebels, Qatar, Hamas, Saudi Arabia, Al-Qaeda, the US, Turkey, Chechen and East Turkestan rebels.
Trying to claim Hamas is some sort of Iranian puppet is just totally bogus. The US pulled the same bogus argument when they claimed Saddam Hussein was harboring Al-Qaeda as an excuse to invade Iraq after 9/11.