There are two justifications for a severe response by Israel to the recent invasion and massacres of Hamas, each itself sufficient, morally and strategically.
The first is the double legitimacy of Israel: It is the senior continuously resident people of the Levant and of what is generally known in the Christian, Jewish, and Muslim worlds as “the Holy Land.” There is certainly room for legitimate discussion of what the final borders of the Jewish state should be, but there has been a Jewish population there for 57 centuries, and in this time of 200 recognized sovereign states in the world, it is preposterous that a Jewish state would not exist in the place where the Jews have always lived, a region in which their seniority is rivalled only by that of Egypt (the nature of whose population has radically changed since the days of the pharaohs).
The second part of this double legitimacy of a constant Jewish presence was a response to the British promise in 1917 on behalf of the Allied powers and the future League of Nations of a Jewish homeland in Palestine, albeit one that would respect the rights of the local Arabs. In 1948, the nations of the world created Israel as a Jewish state. This was the decision of the United Nations, successor to the League of Nations as holder of the mandate for the area, and of all five of the permanent security council members and principal victorious powers in the Second World War: the United States, United Kingdom, USSR, China, and France.
The legal and moral foundations of Israel are further strengthened by the fact that all those in the international community who participated in the founding and recognition of Israel as a Jewish state explicitly recognized that the absence of a Jewish homeland had contributed to the unspeakable and genocidal murder of more than half the Jewish population of the world by the government of Germany and its satraps in the previous decade (Germany an apparently civilized country that had long been relatively accommodating of Jews).