Wi-Fi is expensive for a battery. Staying associated with an access point means waking regularly for beacons, and a Wi-Fi microcontroller draws tens of milliamps whenever its radio is active, with transmit peaks well above that. A door sensor on Wi-Fi therefore either sleeps deeply and spends a second or more reconnecting for each event, or eats batteries.
An 802.15.4 end device wakes, sends a short frame to its parent and is asleep again within milliseconds, with an average current in the microamp range. That is the difference between a coin cell lasting a couple of years and a pair of AA cells lasting a few months. For mains-powered devices such as plugs and bulbs the argument does not apply, which is why those are commonly Wi-Fi.