You should open a business and see why loss prevention is so important in retail. If you pulled that crap in one of my shops, I would ban you from the property. We don't need business from imbeciles. Walmart like all businesses has every legal right to check receipts.
Please cite any statute that gives any business the right to check receipts before "allowing" you to leave with your property. I doubt that any such statute exists.
Once you have payed for the merchandise, it legally becomes YOUR property i.e. YOUR EFFECTS, and the receipt becomes part of YOUR PAPERS.
The 4th Amendment of the United States Constitution protects your right to be secure from unreasonable search and seizure of your person, papers, and effects.
Unless the Walmart employee has reasonable suspiscion that you have stolenmerchandise, (in most States that means someone has to actually witness you stealing the merchandise), then they have absolutely NO RIGHT to seize your person (detain you) and absolutely NO RIGHT tosearch your papers (your receipt).
Because a business is private property, it means that they can deny you entry for any reason, or ask you to leave for any reason, i.e. Open Carry, however, it doesn't give them any special authority to violate any of your Constitutional Rights.