I've had this happen to me a few times, usually at one particular hotel. The solution I came up with is to ask for two keycards when I check-in. This greatly reduces the number of times I need to go back to the front desk as at least one of them will work.