I don't think it's specific to walmart, I've noticed that prices in supermarkets (Target, Walmart, etc.) located in lower priced neighborhoods tend to be lower than those in higher priced neighborhoods. The same item, same brand, same everything, but price difference can be from 10-30% different, sometimes more.
Stores have to make their money to survive, and a grocery store (the side of Walmart we're interested in here) has to deal with nationally advertised prices on a huge portion of their product base, so they adjust prices on the other side to compensate.
What has been pissing me off of late is that Walmart and Target will have shelf prices that are higher than online-for-in-store-pickup. You can get them to price match it but @#$@# annoying.
Yeah, I think it's tied to the costs of running a particular store, and maybe other factors, like local competition. Higher property taxes will generally mean more markup.