What law was broken? He acted in good faith as a customer, and didn't realize their mistake until he was home, and the box was opened. I'll ask this again: What do you think Walmart is going to do with an open box iPad, and what will the immediate consequences be for the cashier? If he had seen that the price was wrong, it would be a moral issue. If he had done something like switch price tags, that's theft by deception. OP told his story, and he was as unaware as the cashier.
When my son left the USAF, he went to work as a store detective for a very large retail corporation. Employees often have their friends come into the store, and fail to ring up all of their items. The items that were rung up are returned, and the stolen goods kept. Stores will track you down if you use a credit/debit card, or even a bonus or rewards card. They don't bother unless it's habitual, or for a large amount, however.
I already know what would happen to the cashier if the OP returns that iPad. My son does not work for Walmart ( they don't pay loss prevention squat), but if their policy is anything like the retailer he works for, they're done.