Wal-Mart's (NYSE: WMT) environmental initiatives and other recent moves have helped reverse its occasionally bad reputation. However, the reemergence of a huge, landmark lawsuit should remind Fools of the risk that still plagues the megaretailer.

The lawsuit, originally filed almost 10 years ago, claims that Wal-Mart paid women less than their male counterparts while offering them fewer promotions. Wal-Mart wants to challenge the suit's class action status in the U.S. Supreme Court. 

Given that the lawsuit includes female employees' claims since June 2001 -- potentially as many as 1.5 million! – an ultimate legal defeat would be a blow to Wal-Mart and its shareholders. According to legal analysts, damages could reach the billions of dollars. The potential risk to Wal-Mart's reputation might be less tangible, but no less damaging.

For years, Wal-Mart's arguably bad and bullying behavior -- particularly towards workers -- made it one of my least favorite stock ideas. I consider such policies a major risk to a business. I grudgingly changed my uber-bearish tune on Wal-Mart in early 2009, figuring that it was a solid stock idea during tough times, with shoppers were in penny-pinching mode.

However, given allegations like this, rivals Costco (Nasdaq: COST) and Target (NYSE: TGT) start to look a lot less risky by comparison. Costco, Whole Foods Market (Nasdaq: WFMI), and Starbucks (Nasdaq: SBUX) have far better reputations and track records for treating workers well, since each has taken a longer-term focus on employees as stakeholders.

Wal-Mart will undoubtedly fight the suit with all of its considerable resources. Shareholders probably shouldn't worry yet, since the case could take years to resolve. Still, long-term investors should take note.

The possibility of a financial comeuppance is important, but not the retailer's only consequence here. Any proof that Wal-Mart treated female workers unfairly and promoted less qualified men could erode public relations, hurt Wal-Mart's sales and earnings, and allow consumers to feel better about shopping at rivals' stores.

Wal-Mart and Costco are Motley Fool Inside Value selections. Costco, Starbucks, and Whole Foods Market are Stock Advisor picks. The Fool owns shares of Costco. Try any of our Foolish newsletter services free for 30 days.

Alyce Lomax owns shares of Whole Foods Market and Starbucks. The Fool has a disclosure policy.