Walmart has had an informal policy of allowing this sort of thing in many locations, but there are typically two reasons why they crack down on it at specific stores:
1. The store may be located in a shopping center where overnight parking is prohibited under a lease provision or a municipal zoning regulation.
2. In areas where crime is a problem, their lawyers or insurance carriers tell them to prohibit overnight parking to protect themselves from lawsuits by crime victims on their property.
3. Ill-mannered truck drivers ruin it for the rest of them by leaving garbage (and worse) behind after parking overnight.