There is a second door (which must have closed first), the camera angle just doesn't show it.
(speculation unfortunately, I don't think there's a confirmed answer)
These screenshots show the door before and after Leia enters the airlock. You can see that there's even a lighted button on the inside for closing the door.
I think it's safe to assume that someone closed that door before they opened the next one. It could have been a crew member pressing a remote button, or it could have even been Leia using the Force to press the button herself.
If it was a well-designed starship, this dual-door system would recognize the vacuum on one side, and only allow one door to open at a time. Perhaps when Poe (and others) opened the second door, it automatically caused the first door to close.