For my use case, Zigbee was vastly preferable to WiFi (or BLE). IP stacks are complex, buggy, and require a lot of configuration -- even moreso if you add encryption into the mix. Zigbee was the simplest tool for the job.
Some of the newer ESP32 boards do support Zigbee but I don't think they were available yet when I started my project. Might be worth looking into ESP32-C6 now.
As others have mentioned, power consumption is also a consideration. My battery powered devices consume about 25uA and should theoretically last 5+ years on two lithium AAA cells.