Much of that money also went to infrastructure, schools, hospitals, etc. Hamas isn't just a killing organization, just primarily.
Iran does seem to make a hobby of irritating everybody then wondering why everyone is irritated with them (Basic "Why is my head always firmly way up my ass, *sniff sniff*?" approach to life), but seems this making peace between Saudi Arabia and Israel was the trigger, Hamas trying to scuttle that, as if the kicking em in the shins "But what about me?" tactic would work.