Israel had nothing to lose, since it was obvious that they would be condemned by most of the world no matter what they did. Might as well eliminate the problem once and for all.
Since one of the reasons Hamas took hostages was to exchange them for Hamas prisoners, perhaps Israel should stop taking prisoners?