Sorry to bust your rant, but as a security geek, I can tell you that security guard did exactly the right thing.
The guard's job is not to make sure they know everyone who enters the building, it's their job to help prevent unauthorized (not un-authenticated) access. She had no way of knowing for sure that you still work there.
There are plenty of stories of guards who did the "nice thing" and let someone in, only to discover later that person had been terminated and had come back to mess with hardware or cause other damage. I've even had to clean up after some of those messes.
Instead of snubbing her, you should be thanking her for doing her job.
Ramblings and references
“A positive attitude may not solve all your problems, but it will annoy enough people to make it worth the effort.” Herm Albright
I haven't found a problem yet that can't be solved by a well-placed trebuchet