If I was out to dinner w/ (hypothetical in my case) hubby & he had the room key, I'm not sure I'd remember to bring mine w/.
And again, the key (pardon the pun) is how the security guard approached it - which was rude. As the OP says: "While I understand the need to register all guests, there are definitely more subtle ways the security guard could have approached us without insulting my wife."
Cheers.