Because an airliner is neither airtight nor watertight. The rate at which the water leaks into the fuselage can be reduced, by closing various valves in the air-con and pressurization systems, in order to give pax and crew enough time to evacuate before the cabin becomes submerged.