They don’t have to actually occupy Gaza. Leveling it may be plenty for the purpose. I’m not sure that’s equivalent of “ethnic cleansing.”
The goal is to destroy Hamas' capability for war. If they destroy Gaza and then leave, Hamas will rebuild Gaza and attack Israel again 20 years from now. They'll have to do what the Romans did to Carthage, or the Russians in Gronzy.