Lt. Gen. Herzi Halevi, who has commanded the Israeli military throughout 15 months of war in Gaza, said he was resigning over its failure to protect against the 2023 Hamas-led assault.