This is important because firstly, you weren’t born in a barn. Secondly, it can actually be a good bit of psychological warfare on your opponents. Typically speaking you can tell if a place has been looted because all the doors get left open. It signifies that a player has gone looting.
So when you come to loot a building or use it as a vantage point, close the doors behind you in order to fool other players into thinking it is a safe loot spot. Even if you leave a building it is wise to shut the door behind you to waste the time of other players, giving you a solid head start and/or the chance to lay some traps.