And Hamas isn't some retard with a .22 for "no reason." You made the analogy, don't just play dumb when it falls apart.
The initial motivation was predictable escalation after Israeli nationalists and police forces took a number of hostile actions during Ramadan, which the West repeatedly told them not to fucking do, constantly, over the course of a month. For every Israeli injured by some mud throwing stones, there are several dozen Palestinians who weren't involved in the back-and-forth injured, hospitalized, or dead, even prior to current exchange.
Hamas' principle mistake was, much like your guy with the .22, firing it at all. It didn't do anything but let guy #2 walk up with his .357 and execute him at first convenience. He could have called someone out of town to explain the story, sought out legal recourse, or indeed, he could have simply accepted the indignity and moved away.