The federal court judge who presided over the divestiture of American Telephone & Telegraph Co. has sternly reminded the regional telephone companies formed by the breakup to remember their obligation to provide basic telephone service to the nation's consumers as they race to expand into diverse new businesses.

"There is a strange gap" between the public's desire for good local telephone service and the companies' desire to diversify, U.S. District Judge Harold H. Greene, who presided over the divestiture of AT&T, said Friday.

Greene issued his warning as Pacific Telesis, parent of Pacific Bell, and another company asked permission to expand their operations.

Complaints about rising local rates, delays in repair and complex telephone bills have increased concern that the 22 local Bell telephone companies, which were reorganized by the breakup into seven regional holding companies, may not be carrying out their primary responsibility to provide local telephone service, he said.

The judge warned the companies not to overlook those obligations as they seek new business ventures. "I have not forgotten these basic facts," he said, adding he also is concerned whether the companies were siphoning revenue from consumers to launch businesses. For such ventures, the companies are allowed to use only their own profits or proceeds from debt offerings.

Greene said that the court has granted 28 waivers to the decree that allows the regional companies to operate businesses ranging from real estate to office furniture to computer sales. An additional 18 waiver requests are pending, he said.

When the consent decree was issued in 1982, the court gave the regional companies permission to enter two areas other than basic telephone service: marketing telephone equipment and publishing the Yellow Pages.

As Greene noted in court Friday, those exceptions were made at the time because the regional companies "were not the giants we are talking about today."

At the hearing Friday, Pacific Telesis asked the court to allow the regional holding companies to offer cellular car telephone service outside their existing territories. Pacific Telesis, along with Chicago-based Ameritech and U S West of Englewood, Colo., have said publicly that they want to compete in cellular markets outside their regions.

Robert Dalenberg, general counsel for San Francisco-based Pacific Telesis, argued that there is nothing in the consent decree that prohibits the regional companies from operating outside their territories. But Justice Department attorney Kenneth Sullivan disagreed, saying that the decree clearly implied that a company's operations were to be confined to geographical limits.

According to Greene, one reason that the consent decree may not have defined territorial limits clearly is because "no one dreamed when the decree was written that the regional companies would be spreading out all over the world."

Ameritech, meanwhile, asked Greene for permission to work with developers of office buildings to design a telephone system for all tenants. Kenneth E. Millard, an Ameritech attorney, insisted his company would play no role in choosing a long-distance telephone company to supply service to the building.