"But what about the innocent civilians in the Gaza Strip who will die when the IDF invades?"
You're not wrong. Your sentiments are appropriate.
Whenever innocent civilians perish it is a tragedy, regardless of whose side they have fortune or misfortune of being on. A civilian death is a civilian death; a life is a life.
Part of governance, though, is to use one's power and authority to protect the lives placed under oneself. Hamas is the governing power and authority in the Gaza Strip.
The IDF is far more powerful than Hamas; Hamas knew this. It was Hamas who chose to aggravate the IDF, knowing they were provoking a superior military.
It was Hamas that not only invaded Israel, and not only chose to kill and kidnap Israeli men of fighting age, but reached down into the depths of reptilian barbarity to behead dozens of infants, kidnap and murder children, women, and even the elderly. It was Hamas that then bragged about this to the world by publishing videos of their preparations and the crimes themselves.
And after this act of utter barbarity -- after not only throwing rocks at a bee hive but putting a snake inside it - after ensuring that the IDF would doubtless respond and likely catch their own civilians in the crossfire -- they resumed launching missiles into Israel.
The IDF will invade, and will annihilate Hamas. If Hamas cared about their own innocent civilians, they would hide them in the tunnels, and help smuggle them across the border into Egypt. Instead, Hamas, the governing power and authority in the Gaza Strip, will kick their civilians out of hospitals so that their own soldiers can make their bases there, in hopes that the world will be naïve enough to think that any attack on hospitals would be attacks on patients. In inevitable ground combat, Hamas will use their own citizens as human shields.
It will be a mournful and profoundly regrettable tragedy when any innocent civilians in the Gaza Strip lose their lives in the inevitable IDF invasion. But their blood will be entirely on the heads of Hamas.