Federal National Mortgage Association, a Washington corporation that is the nation's largest single owner of home mortgages and the largest diversified financial services company, yesterday reported its fourth consecutive quarterly loss and its first yearly loss since becoming a publicly traded firm.

But Washington banking companies American Security Corp. and NS&T Bankshares Inc., as well as spice-king McCormick & Co., reported banner years.

The good news in the report from Federal National Mortgage was that losses in the final quarter of the year declined to $70.7 million from $79.5 million in the prior three months, evidence that higher fees and new mortgage programs have started to have a modestly favorable impact on the bottom line.

The loss in the recent quarter for Fannie Mae, as the firm is called, was in contrast with slim profits a year ago of $700,000 (one cent a share), in an already depressed period when interest rates had risen sharply and made the cost of raising funds higher than the interest yield earned on mortgages.

Fannie Mae supports a secondary market for mortgages by borrowing money in the market and using the funds to buy mortgages from primary lenders, thus freeing more funds for mortgages.

For the full year 1981, with the costs of borrowing at record levels, Fannie Mae rolled up losses of $190.4 million. The average return on the company's $60 billion mortgage portfolio is less than 10 percent, and borrowing in the open market has often cost more than 15 percent, thus forcing Fannie Mae to cover losses with retained earnings from profitable years in the past. In the relatively depressed prior year, FNMA profits were $14.2 million (23 cents a share).

Chairman David Maxwell said yesterday that fees earned from issuing new conventional mortgage-backed securities "contributed significantly" to improving Fannie Mae's earnings in the recent three months. The firm issued $3.3 billion of these securities commitments in the final quarter, earning $19.9 million of fees.

Although a slow decline in interest rates is expected to help Fannie Mae this year--reducing the gap between borrowing costs and money earned on its mortgages--the company is expected to operate with another net loss for all of 1982. Stockholders' equity of more than $1 billion, mostly retained earnings, provides a cushion to cover losses for a long period, Maxwell emphasized.

In contrast, American Security Corp., the parent firm of American Security Bank, posted a 7 1/2 percent increase in fourth-quarter profits to $6.6 million ($1.82 a share) from $6.1 million ($1.72), not counting losses from selling securities in both periods. Net income was $5.91 million ($1.63) vs. $5.92 million ($1.66).

For the full year, operating profits of American Security rose more than 11 percent to a record $27.1 million ($7.53) compared with $24.4 million ($6.77) and net income rose to $26.1 million ($7.24) from $23.8 million ($6.62) after securities trading losses in each of the two years.

With the 1981 results, ASC has moved into first place among Washington banks in terms of earnings power. Arch-rival Riggs National Corp., which owns the city's largest bank in terms of deposits and assets, reported last week that its operating profits were unchanged from 1980 at $24.35 million. Although Riggs profits rebounded in the fourth quarter (up 18 percent from a year earlier) to $5.86 million, American Security topped the quarterly earnings, too.

"There is no denying that 1981 -- in terms of interest rate fluctuations and intensive competition for both loans and deposit funds -- was a difficult and challenging year for our industry, and that is all the more reason to be encouraged by our performance," ASC Chairman W. Jarvis Moody said yesterday.

ASC surpassed $3 billion in assets at year's end, an increase of more than 12 percent from a year ago. Loan volume expanded by 11 percent to $1.6 billion and deposits increased 10 percent to $2.4 billion. At Riggs National Bank, assets rose 16 1/2 percent in 1981 to $3.7 billion while loans expanded by 11 percent to $1.7 billion and deposits grew 20 percent to $3 billion.

NS&T Bank of Washington said operating earnings in 1981 rose 15 percent to $5.4 million ($11.82 a share) compared with $4.7 million ($10.35) the previous year. Fourth-quarter operating profits were up 9 percent to $1.3 million ($2.87) from $1.2 million ($2.69).

Chairman Joseph Riley said total loans rose 29 percent to $409 million, assets were up 12 1/2 percent to $576 million and deposits increased 20 percent to $486 million. Directors approved a dividend of 45 cents a share payable Feb. 1 to owners of record Jan. 22 -- a 12 1/2 percent rise in the payout rate from 1980.

D.C. National Bank and American Indian National Bank of Washington also reported record earnings from operations in 1981.

D.C. National said profits before securities transactions rose 16 percent to $2.2 million ($10.39 a share) from $1.89 million ($9.22) a year earlier. Assets of the city's seventh-largest commercial bank rose from $138 million to $157 million at the end of 1981. The Federal Reserve Bank of Richmond recently approved D.C. National's proposal to form a bank holding company, D.C. National Bancorp Inc.

American Indian, which operates a representative office in Albuquerque in addition to its main office here, said earnings in 1981 rose 50 percent to $687,061 compared with $457,957 the previous year; per-share figures were unavailable. The growth in profitability was attributed to a sharp expansion of average deposits to $24.4 million to $15.1 million, with new marketing efforts last year focused on Indian tribes and enterprises. Cumulative earnings of the bank in 1979, 1980 and 1981 have wiped out losses recorded in its formative years of the early 1970s.

McCormick & Co., the Maryland-based international spices and foods manufacturer, said profits expanded sharply in the quarter and year ended Nov. 30. For the recent three months profits were $17.5 million ($1.41) compared with $7.3 million (66 cents) as sales rose to $204 million from $167 million. For the fiscal year, earnings were $30 million ($2.50) vs. $13.2 million ($1.17) and sales increased to $660 million from $528 million.