bad yield on cash right now. Interest rates are low, so buying a company with greater ROE than near-zero interest rates is probably good. Unlike many big tech companies, Walmart also has plenty of debt already, their June filing indicated ~$39.4 billion in long-term debt, so adding to that is less appealing than just paying cash. Note: they could do what MSFT did with linkedin and later change their mind and issue debt, since it is very inexpensive to borrow, and Walmart has a good credit rating.