At a hearing in Manhattan in March, U.S. District Judge Jed Rakoff had a question for prosecutors who had argued that Bank of America Corporation should have to pay $2.1 billion over its Countrywide unit’s massive mortgage underwriting lapses: Why, he asked, weren’t they demanding more?

In a rare move, the judge encouraged them to think bigger—closer to $5 billion, the amount Fannie Mae and Freddie Mac had to pony up in insurance claims when the Countrywide-underwritten loans failed by the thousands. (BofA’s attorneys, meanwhile, argued that the penalty should be no more than $1.1 million.)