Just a reminder, palestinian civilians are not allowed to own guns, this is restricted in the Oslo accords.. So **any** argument about the Palestinians allowing the hamas is invalid.
In that sense one can say that the existance of Hamas is entierly on the shoulders of israel (the ones who enforces the oslo accords)