When you chose to start a war, you risk losing that war and part of the price is the loss of land. Despite what the UN says, which is dominated by anti-Israel members, their occupation is not illegal. Indeed, the only solution to this conflict, which has been going on since before Israel became a country in 1948, is a scorched-earth policy carried out by the IDF. Since Hamas started this war and has massacred thousands over civilians in the process, the IDF is totally justified in anything they do to eliminate Hamas.