No, it is not a bug - it is intended. During first few alpha versions, it used to be the case that you could teleport into closed rooms and houses from outside. However, it was insanely overpowered (why then would you need lockpicking or bother looking for a key?) and was removed on players' request.