Failure of a counterinsurgency operation is usually easy to spot. While not every outcome is so simple, the trail of destruction that Israel left on its way out of Gaza was destined to haunt the region.
There are two ways of looking at the Gaza War. War itself is hideous, a fact that cannot be lost, and every war experiences human rights violations. Hamas continually provoked Israel with rockets with the intention of luring Israel into the Gaza Strip, seemingly giving the IDF a blank check to act as it wished. The problem appears to stem not from the battle itself, but from Israel mistaking a counterinsurgency for a war.
In regular war the people don't matter as much. Generally the goal is to attain submission, whereas counterinsurgency seeks to gain acceptance. While Israel was justified in acting as it saw fit, Palestinians were also justified in their outrage. The IDF chose to portray the standard aggressor instead of a helping hand to alleviate the suffering of Gazans. Israel seems to believe it can bomb Palestinians out of their political support for Hamas, a tactic that hasn't succeeded.
Israel may have had no choice, but the Gaza War is chasing it to this day. The human rights violations it supposedly committed will likely never be brought to trial, just like the July War in Lebanon, but this fact hardly matters. Counterinsurgency doesn't care where the trial is held, in the Hague or in the court of public opinion. Most Muslims and many non-Muslims have decided that Israel, besieged as it was, committed an array of disturbing acts in Gaza. Demonizing the UN and Human Rights Watch is a thin defense that offends Muslims further.
Seven months after the war, Israeli failure in Gaza is unmistakable. Hamas was neither removed nor weakened and continues to smuggle weapons, while Palestinians view Israel as bloodthirsty and cruel. Allegations of war crimes will hound Israel for the foreseeable future and continue to destroy its image in the eyes of Muslims. Israel's only prize was a temporary ceasefire from Hamas, but this lull will evaporate if peace negotiations continue to stall. The war was ultimately waged for political consumption in Israel, a far cry from counterinsurgency.
Neither war nor peace seems to have a permanent effect in the Holy Land, but given the repercussions for Israel, it had more to lose in going to war than negotiating with the Palestinians. Counterinsurgency in Gaza would be more effectively waged through the pursuit of a two-state solution, the best hope to demilitarize the region. IDF tanks, warplanes, and snipers aren't counterinsurgency, only urban warfare.