I've always thought this had more to do with change or attention blindess. The guard looks at identical cards so much that they just can't see that something isn't a card.
I think it's also a convenience thing. One of the most common ways for border agents to go on strike (in Europe at least) is to say "We are going to follow the law to the letter on day so and so"
People end up waiting to cross the border for hours on end.
I imagine security guards at a high traffic building have similar leverage and reasons to be lax. When a few hundred or thousand people have to get in through the lobby every morning in the span of 1 hour ... well I think most people would say "You know what, the probability of something bad happening and the consequence if it does is so low that we'd prefer convenience than standing in line for 3 hours to get to work"