When you've paid for something and are leaving the store, if an employee demands to see a receipt, I'm pretty much within my rights to tell them to get the hell out of my way, right?
It does depend heavily on the scenario. If it's a regular store employee I'm probably going to show them the receipt or politely decline them. If it's one of these "store security" people in their halloween policeman costume I'm much more likely to respond defensively and tell them to get the hell out of my way.
They're just doing their job; as long as they're polite about it, they're not picking on you or being nasty; they're doing as they're told. Smiling and treating it as an inconvenience, but the fault of the management rather than of the person asked to watch the door, would be a much better reaction. Anyway, I cannot see a good reason not to show your receipt, unless you told the cashier that you didn't need one, in which case it might be worth going back to them and saying 'excuse me, can you vouch that I bought these things a minute ago?'. Politeness costs nothing, and does make a big difference for service sector employees - don't be one of these people
In the UK, most shops large enough to hire security have scanners on the door anyway, so this hasn't ever happened to me, personally: in the days before scanners, we were a far more trusting society.