Buddhist origin:
空 ("emptiness") is a core Mahayana concept (śūnyatā), so
空门 = "the gate into the doctrine of emptiness" = the Buddhist religious life. The fixed phrase
遁入空门 (dùnrù kōngmén, "to flee into Buddhism") is the standard way of describing someone becoming a monk or nun. Soccer commentators borrow the second sense — an open goal with no defender — and burglary news the third (
闯空门 "break into an empty house").