All residents of my apartment building have a key fob to access the main lobby and get to their home. If someone is behind me, I try to pay attention to see if 1) I recognize them and know that they live in the building, or 2) they're holding their own key fob. If it's one of these two things, I hold the door open for them.

This one time, there was someone behind me that I've never seen before. They weren't holding a key fob, they were just walking behind me. I opened the door and made no effort to hold the door for them. If this was a public place, I wouldn't have an issue holding it open for them. This person got incredibly mad at me, practically yelling how unbelievably rude I was. It made for an interesting elevator ride up.

I've also lived in a building that had underground parking. There's a large sign that says "please wait until the gate closes before driving off". I feel like this is so people who don't live in the building can't gain access. Isn't this the same thing?