Welcome to the forum!
Your response was perfect, particularly abandoning the unpurchased items. Let me guess: there were no police waiting outside to nab you.
By the way, Walmart's corporate policy is that each store follows the local law. You were legal, and if you pursue the matter, you could probably get the local fool straightened out from above. But why bother? Voting with your feet is good enough!