In a strange reverberation of the housing crisis, Goldman Sachs Group Inc. has become a voracious buyer of soured mortgages, trying to make money even as it looks to fulfill terms of a government settlement that calls for it to help struggling homeowners.

Over the past year-and-a-half, the Wall Street giant has become the largest buyer of severely delinquent home loans from mortgage giant Fannie Mae. The firm has acquired nearly two-thirds of $9.6 billion in loans the agency has auctioned, representing unpaid loan balances...