Legally and morally.
They cannot detain you without seeing you take an item, seeing you hide it, seeing you leave without paying.
Period.
Their policy doesn't mean jack.
Go picket Walmart. Fight the system, dude.
Or, go to Walmart and make purchases, leave and refuse to show your receipt when asked. Then, sue. Repeatedly.
It’s folks like you who make America great. /s