The chairman of the Securities and Exchange Commission warned the nation's brokers today that the movement of securities firms into other lines of business is disturbing.

Harold M. Williams said the old-line brokerage firms could end up shifting their focus from the economically important functions of buying and selling stocks and bonds and underwriting new securities offerings.

He also said that diversification "may place unexpected strains on management systems and expertise" and catch the industry unprepared when a sizable upswing in stock trading occurs.

A number of brokerage firms, led by Merrill Lynch, have moved into a wide variety of fields beyond the normal securities business.

Several are in real estate, others have move into insurance, annuities, commodities trading and options trading, among other things. Merrill Lynch, the largest Wall Street firm, pioneered the diversification movement in the early 1970s.

The brokerage firms argue that because the stocks and bonds trading business is so up and down, they must diversify into other businesses that are less cyclical.

Merrill Lynch spokesman John F. Kelly said the company's diversification has not interfered at all with its commitment to the brokerage business. He said that in the past couple of years the company has added more than 1,800 brokers and "about 100 branch offices as it prepares for the increased business it sees for the 1980s."

He said the company tested itself this summer and found it was ready to handle a 100-million-share day. Merrill Lynch, Kelly said, plans to continue to diversify.

Almost as Williams was speaking to the annual meeting of the Securities Industry Association here, one of the big Wall Street firms -- Bache Halsey Stuart Shield Inc. -- announced on the West Coast that it would buy a large Los Angeles insurance broker for $3.5 million.

At a news conference before his address, Williams said that as brokerage firms move into other activities, "one wonders about the focus of the industry . . . Sales organizations will go make the easiest and most profitable sales," which often may be in areas other than stocks and bonds.

Williams said the day could come when 150 million shares of stock are traded (the record so far is 81.6 million, set last month) and brokers will be out "selling life insurance."

Williams also warned that because brokerage firms are diverting increasing amounts of "capital and expertise to pursuits only remotely related to core securities operations, at the very least, (diversification) reduces the industry's capacity and flexibility to cope with and plan for tomorrow's conditions in the markets."

He said brokers should be planning for days in which 150 million shares of stock are traded. Today, an average of 32 million shares a day are traded on the New York Stock Exchange, compared with 28 million last year and about half that a decade ago.

In the late 1960s, stock trading had to be restricted because of the inability of brokerage firms to process and deliver to customers their securities because of what was then considered the huge volume of trading.

Although sizable "back office" improvements have been made since the late 1960s, the industry must make many more if it is to cope with the 1980s, he said.

Williams also warned that by diversifying, brokerage firms might be giving off signals to their customers that they are reducing their long-term "ability and commitment to service fully the needs of issuers and investors." If that happens, he said, new competitors will move in.

While brokers have been moving into other fields, they have resisted others, such as commercial banks, who want to move into some fields that have been reserved for securities firms, including the sale of municipal revenue bonds.

Williams also said he is concerned by the large number of securities firms that have merged.