Lots of reasons for this:
1. Hostility in some spots to Wal-Mart's inexorable expansion.
2. A slew of employee lawsuits, notably one claiming discrimination against 1.6 million women. Wal-Mart denies that but warns that the suit could lead to material, unestimatable losses.
This kind of uncertainty is what hurts their share price since EPS was up almost 19% last year. Their balance sheet is solid and their earnings power is unmatched in the industry. They also have huge piles of cash.
Capital spending eats up $.86 of every dollar of cash flow as they continue to rapidly expand. When capital projects start accounting for a smaller portion of cash flow, leaving more for the dividends, buybacks, and debt repayments their share price will increase dramatically.
And their stock price is down roughly 20% over the last 5 years while Costco is up by almost 1/3rd. Whatever Costco is doing, the market seems to like it more than whatever Walmart is doing.