At a time of economic uncertainty in the wake of October's stock market collapse, the banking and savings and loan industries are taking one of their worst beatings ever.

Although banks earned a record $5.8 billion in the third quarter ended Sept. 30, the industry's profits for the year are expected to fall to the lowest level since 1934 because of continuing problems with loans in the Southwest, federal banking regulators said yesterday.

During the third quarter, S&Ls lost $1.6 billion, federal S&L regulators said. About 39 failing S&Ls in Texas accounted for $1.3 billion -- or 81 percent -- of the quarterly loss, the officials noted.

The S&L industry's loss exceeds $3 billion for the first nine months of the year, the officials said. Depending on results in the fourth quarter, which ends Dec. 31, the S&L industry's yearly loss could rival the record $4.6 billion loss of 1981.

The third-quarter results were released by the Federal Deposit Insurance Corp., which insures deposits up to $100,000 at banks, and by the Federal Home Loan Bank Board, which regulates and insures S&Ls.

The poor earnings reports are another jolt to the banking system and the economy. They come at a time of concern that the sagging economies of the Southwest and of South America -- two trouble spots for banks -- may not improve any time soon and amid rising fears that taxpayers may have to bail out a growing number of failing S&Ls.

"Clearly the economy in the Southwest is not improving," Federal Deposit Insurance Corp. Chairman L. William Seidman said. "Right now we do not see any recovery in the figures."

He said that oil and real estate prices have fallen and that there is great uncertainty on how far they will fall.

The banking industry's hefty profits in the third quarter followed record losses of $10.6 billion in the second quarter.

Federal regulators said third-quarter earnings were high because banks took record writeoffs in the second quarter, mostly from soured loans to the energy and agricultural regions of the United States and to Latin American countries. Bad loans in Texas and the rest of the Southwest are likely to dampen banks' earnings in the fourth quarter, the officials said.

Seidman estimated that the nation's federally insured banks will earn $4 billion in 1987 on assets of $3 trillion, giving them a return on assets of 0.02 percent. That would be the industry's lowest return on assets since 1934. "It's minuscule," he said.

Seidman said the stock market plunge has boosted deposits at banks but it is too early to tell what overall impact it will have on the banking system.

FDIC spokesman Steve Katsanos added, "We don't think from what we've seen that the crash will have any direct effect on banks in the fourth quarter" due to losses on loans to securities dealers.

But, Katsanos said, "Over the longer term, if consumers stop buying and express concern about the state of the economy and business reacts to consumers -- that will be an indirect effect that could hurt the banks."

Bank regulators said 191 banks have failed or have required federal assistance so far in 1987, and two dozen more failures could occur by year's end. Seidman said failures would fall in 1988, but not by 25 percent as he had predicted last summer.

"We took out our crystal ball and now we are eating a little glass," Seidman joked.

Despite the overall loss for the S&L industry, more than 70 percent of the nation's 3,200 S&Ls had a profit for the third quarter, with 2,244 institutions earning a total of $1.5 billion, federal officials said. But the gains were offset by 934 unprofitable S&Ls that lost a total $3.1 billion, they said. While 30 percent of federally insured S&Ls lost money in the quarter, 340 -- about 10 percent of the industry -- were insolvent. (An insolvent institution's liabilities exceed assets under bank board regulations.) The problem was most severe in Texas.

"But unprofitable does not mean an institution's insolvent," said the Federal Home Loan Bank Board's chief economist, James R. Barth. "That's an important distinction. An institution can have a quarterly loss and still be economically viable."

But he said the problems of Texas S&Ls are a drag on the entire industry, and weeding them out of the system is a top priority of the bank board. "As Texas goes, so go the nation's thrifts," Barth said. He said a recent decline in interest rates should continue to boost S&Ls profitability, or at least lessen losses at many institutions.

Bank board chairman M. Danny Wall has said the agency will close an S&L a week in 1988.