Walmart applies the term "straw sale" to pretty much anything that involves an age restriction, from bottles of bb's to AR-15s. The reason is simple. All it takes is one mistake and the store can be in serious trouble.
I would have gone along with letting them see the card, but I don't like trouble. Then again, I almost never get carded anymore. If I didn't mind standing around, I would have run it up the chain of command right there. That means asking for a "salary member of management." There is always at least one in the store, and they are the people who can hire, fire, and give raises; and they can also give discounts to customers...
Also, I don't know why associates get the reputation of being stupid. Many are college educated or college students, and few if any make minimum wage. Some obviously need training on the details of policy and how to apply it with common sense.