Fannie Mae and Freddie Mac plunged in New York trading after investors including Bruce Berkowitz’s Fairholme Capital Management LLC lost a legal bid Tuesday to force the bailed-out companies to share profits with private shareholders.

The mortgage giants had surged for more than two years on speculation that shareholder rights to the earnings could be restored.