I locked myself out of the room on several occastions, and at the very least they ask for your name and double check in the system. It's not as easy as you describe.
While I'm sure some hotels (maybe more upscale ones?) do verification, it is far from universal in the USA.
In my experience, keycards fail so often that the hotel workers don't bat an eyelid when you say your card has failed, they just make you a new one.