Selling firearms puts a pretty steep burden on the store.
Guns have to be accounted for at all times and kept in a secure area. The paperwork requirements are not insignificant. Sale of a single gun can take a half-hour or more even for a well trained and experiences clerk. The paperwork has to be filled out properly, information sent to the right places, and maintained in good order.
All this requires that there will be enough trained people for two or three shifts per store. Plus some extra for no-shows and turnover in the slightly over the minimum wage, high turnover, workforce. Every one of these requirements costs time and money and these extra expenses have to be considered when deciding how profitable selling guns really is.
The odds are that the profit margins are usually higher selling vitamins and tightie-whities than firearms. You make less on each purchase but the retail store invests less in time and money to sell them.
Wally World, like most major retailers, calculate their profits in terms of profit per square foot of floor space. They often rejigger their array of goods not so much by what sells and what doesn't, even though that is included, so much as what makes the most profit per unit space occupied. Cheap one and two dollar Chinese gewgaws are very profitable because they only cost the retailer a few cents each and impulse buyers snap them up by the thousands.