In other words, Palestinian civilians are being turned into legitimate targets by their Hamas "government" terrorists using them as human shields.
If you look into the laws of war, civilian collateral casualties are acceptable (as tragic as that is) if their losses are "proportionate" to the military advantage obtained by taking our the actual targets.
Note that "proportionate" refers to the military value of the targets being engaged, not, as many ignorantly assume, in proportion to your own casualties.
War is a terrible thing, and the cost in human lives and suffering is nothing short of traffic. However, the Palestinians brought this onto themselves by electing Hamas and (in the moral sense) by a majority of them continuing to support Hamas and to hold their massive terror attack on innocent Israeli civilians living inside Israel as well as taking hundreds of hostages on Oct 7 as justified.