U.S. commercial banks earned $6.2 billion in the first quarter of this year despite setting aside almost as much, $5.8 billion, to cover future loan losses, the Federal Deposit Insurance Corp. reported yesterday.

As a result of the loan provisions, bank profits for the quarter were down $1.1 billion from the record level of $7.3 billion in the first quarter of 1989. Banks set aside so much primarily because of a substantial increase in soured real estate loans, particularly in the Northeast, where overbuilding of condominiums and commercial office buildings has bankrupted many developers.

The FDIC report once again described a banking system under considerable strain because of continuing losses but nevertheless profitable enough to more than cover such losses.

Even with the real estate loan problems, bank earnings were up sharply from the previous two quarters, when they totaled a scant $1.4 billion.

Another positive sign was that the number of banks federal regulators believe to be in enough trouble to be especially watched continued to fall.

However, the FDIC's quarterly report on the condition of the banking system cautioned, "For the remainder of the year, the outlook for commercial banking performance is mixed. Small banks should continue to show improvement, especially in the Midwest and Southwest regions, while many medium-to-large institutions in the eastern United States are likely to experience further difficulties with real estate loans."

The report from the FDIC, which runs the fund that insures deposits in accounts up to $100,000, said the results of examinations by federal banking regulators later this year may mean that banks will have to set aside still more money to cover losses on real estate loans and on loans used to finance so-called highly leveraged transactions such as corporate takeovers.

At a press conference, FDIC Chairman L. William Seidman emphasized his concern with the spread of real estate problems from the Southwest to the Northeast and into some other parts of the nation as well.

Seidman noted that between the end of December and the end of March, Rhode Island, Florida and Utah joined 13 other states in which the share of real estate loans on which payments were not current is 3 percent or more.

The highest percentage of noncurrent real estate loans were in Arizona, 11.2 percent, and Massachusetts, 9.2 percent.

Meanwhile, nine more states joined the ranks of those in which the delinquent share of such loans was between 2 percent and 3 percent. All were in the nation's northern tier, stretching from Montana and Wyoming eastward to Vermont.

Aside from real estate, Seidman said, "we don't see an adverse trend" in any other part of bank lending.

During the quarter, 36 banks failed and the number of banks operating in the country fell by 115 to 12,588. Between the end of March and last Friday, another 46 institutions failed, including nine owned by one bank holding company in Texas.

Earlier this year, Seidman estimated that between 150 and 175 banks would go under in 1990. Yesterday, he said, "Right now what's going on would put me on the high side of those numbers." More than 200 banks failed in each of the past three years.

Partly as a result of the disappearance of failed banks, the number of so-called problem banks -- those that score a 4 or 5 on bank regulators' scale of 1 to 5, with 1 being the best -- declined to 1,058 from 1,092 at the end of last year. They were at 1,394 at the end of 1988.

In another sign of strain within the banking system, institutions wrote off as uncollectable $6.6 billion worth of loans, the bulk of them to developing nations, in the first quarter. The write-offs are taken from loan-loss reserves previously set aside.