I agree with you. You were buying a legal product. WITH CASH. It's none of the vendor's DAMN business what your "legal" status is. This is NOT a voting booth or a job interview. It's a free-market transaction.
I've heard other horror stories on other threads about Dick's. Let me be the first to say: Dick's is for d**ks.
Perhaps they were trying to avoid a customer getting into trouble over purchasing ammo without knowing the law. In that case, it would have made more sense to have put up a notice saying "Non-US citizens should check for possible restrictions on legally buying ammunition" or some such.