Over the past couple years, about 20 separate lawsuits have been filed with the goal of changing the profit-distribution arrangement of Fannie Mae (OTC:FNMA) and Freddie Mac (OTC:FMCC). Specifically, both common and preferred shareholders are upset that the government decided to keep 100% of the agencies' profits for itself.

Source: www.futureatlas.com.

Well, the hopes of shareholders just received a crushing blow as a U.S. District Court judge dismissed several of the lawsuits on Tuesday, causing shares to plummet by as much as 50% the next day. So what happens now? Is there still a chance that the remaining lawsuits will succeed, or should shareholders run for the exits?

Not right, but not necessarily illegal
Just because the government's actions might not be morally right doesn't mean they are illegal, and that's essentially why the lawsuits were dismissed.

Judge Royce Lamberth ruled that the Federal Housing Finance Agency has the power to take Fannie and Freddie's profits as part of the Housing and Economic Recovery Act.

While the judge seemed to sympathize with shareholders somewhat by saying the "feeling of discomfort" is understandable, the 2008 law and the language on the stock certificates for the government-backed enterprises gave cause for dismissing all of the claims.

The dismissal covered at least 10 separate claims, including some of the most high-profile lawsuits filed in the case, including those filed more than a year ago by investors Perry Capital and Bruce Berkowitz's Fairholme Funds.

Will the remaining lawsuits succeed where others failed?
The dismissal didn't include the high-profile Pershing Square lawsuit, which covers common shareholders (the dismissed lawsuits were mainly based on the rights of preferred shareholders), and was filed more recently. Pershing Square is the largest shareholder of both Fannie and Freddie, with about 10% of the common stock of both entities.

Also remaining is another Fairholme lawsuit that deals with the preferred shares, as well as at least eight more that challenge the government's arrangement.

However, the possibility of success seems rather slim. Preferred shareholders are considered "superior" to common shareholders in terms of profit distribution and recovery of assets. So, if some of the largest preferred shareholders were unsuccessful in challenging the current arrangement, there is little reason to believe the outcome will be any different for those who hold common stock.

While the remaining lawsuits' chance of success is not good, anything is possible here. Since they are being overseen by a different judge, it is certainly possible the ruling will be different. Also, the plaintiffs in the lawsuits that were just dismissed haven't yet made clear whether they intend to appeal the judge's decision. Quite frankly, this remote possibility is the only reason the share prices aren't a lot closer to zero now.

What should shareholders do now?
The dismissal of the lawsuits clears a major obstacle for the ongoing efforts in Congress to dismantle Fannie and Freddie. Lawmakers have introduced several bills that would eliminate the organizations, and have not quite agreed on any terms yet. But it would definitely be easier to accomplish if they don't have to worry about compensating shareholders.

Basically, without a reasonable chance of receiving some sort of profit-sharing, there is simply no reason to own shares of Fannie and Freddie anymore. Since shares were trading for just pennies a couple years ago, shareholders who bought in then should get out while they are still sitting on some gains.

Those long-term shareholders who were holding out hope that their investments would once again be worth something similar to the pre-crisis valuation might want to consider getting out while their shares are still worth something.

I have written several times over the past year about the potential hazards of investing in Fannie and Freddie, saying that it was more of a gamble than an investment. Now it looks like it was a gamble that isn't going to pay off.

This article represents the opinion of the writer, who may disagree with the “official” recommendation position of a Motley Fool premium advisory service. We’re motley! Questioning an investing thesis -- even one of our own -- helps us all think critically about investing and make decisions that help us become smarter, happier, and richer.