I don’t shop at Walmart, but I agree with you. A private business can certainly ask to see your receipt as you leave.
They can ask you but you don’t have to show it to them.