Walmart won't run an unprofitable store, as you mentioned. From my time working there[0] their strategy was mostly to put stores as far out as possible from a warehouse hub and work backward. To be honest, Walmart isn't known for closing alot of stores, they tend be very good at figuring this stuff out, at least.
Which is to say, I know they don't take a loss on stores, even news ones. They may have loss leaders, but they make a small (and I mean small) profit on most things sold in the store. Its all about volume.
Their labor practices are quite abhorrent. Not to mention they employ enough people to make a small city (2 Million+ last I checked). I don't know if they been good on balance or not, I do know they are the epitome of Corporate Exploitative Practices[1]
They also have an entire division that exists just to extract tax favor-ability for building in places. They've gotten really good at pitting towns against each other for their business.
That said, all of this is true for Target too. All of it. It just doesn't have the same poor brand reputation and it being the smaller of the two it gets less media attention for its poor practices.
[0]: I really resent them after working there though. I haven't stepped foot in an WalMart since that time period. It worked for that time in my life and I had one of the "better" jobs for sure, but it was rough to see what they did to associates and being part of that machine.
[1]: Its well studied that they have an enormous amount of their workforce on government subsidies / benefits. To the point that they have handouts to help people get on assistance that work there, rather than pay them a living wage. Its nuts when you really think about it.