A while back, all Walmarts carried long guns in my area (roughly pre-Obama time period). Walmart decided to choose a couple stores in each region to sell firearms and the others would only stock ammunition. In some markets they sold no firearms. That happened and continued for a couple years.
Then Walmart changed their mind and chose to stock firearms in most stores again. I would assume that Walmart saw the national sales figures and decided they wanted a larger piece of that action. This included AR's and other similar rifles if the manager wanted to carry them. It is all about sales.
If WM really wants a larger piece of the firearm market, they will have to carry handguns. I have heard that they are considering selling handguns as well.
Having never worked at a Walmart, I suspect they might have to take more substantial security steps for handguns in their warehouse and storage areas of individual stores unless all of the stock is "on the shelf". But since most stores are open 24hrs, they don't have to move their inventory back and forth from the safe to the sales area daily like places like Bass Pro currently do.
In the past, places like Western Auto and other similar stores, Sears, JC Penney, and Montgomery Wards sold guns. Their sales volumes were high enough that some carried their old "brands" such as Sears (Ted Williams). My first 22 came from a Western Auto.