Legally speaking, walmart can ask to see your receipt, but since it’s not a membership store, or has it in their Terms and Conditions of purchasing goods there, they can’t stop you from just not showing it
I do this as well. One day I was in a hurry on a lunch break and I was getting batteries and a sandwich, literally two items in a single bag. The person stepped in front of me and started to ask to see my receipt and I just snapped out “no thank you” but when they just stepped aside I realized there was no reason to ever let them and I havent since.