A federal judge yesterday cleared the Securities and Exchange Commission of wrongdoing in its three-year investigation of Gulf & Western Industries and of two of the company's top officers who were accused of widespread violations of federal securities laws.

The ruling means that the SEC's case against the company and its officials will continue.

The SEC had filed a civl complaint against the conglomerate and the officers in 1979, charging the three defendants with violating a wide range of securities regulations, from misusing pension funds to using millions of corporate dollars secretly to inflate the books of the Dominican Republic's central bank. Some of the information came from a Gulf and Western outside counsel, Joel Dolkart, as part of a plea arrangement on criminal charges pending against him.

Gulf & Western later accused the SEC of violating the attorney-client privilege by talking to Dolkart, and of punishing the defendants and stripping them of their rights to a fair trial by leaking information to the press. The corporation said if Dolkart's cooperation with the SEC were sanctioned, attorneys would be tempted to reveal their client's privileged information whenever they got in trouble.

U.S. District Judge Barrington D. Parker said, however, that his decision "should not be read to endorse such a practice" of lawyers breaking confidences.

Dolkart made a special effort not to disclose to the SEC staff confidential information he had obtained as a Gulf & Western counsel, and Dolkart had provided information while wearing his other hats as a Gulf & Western director, secretary and a member of its pension advisory committee, Parker said.

Gulf & Western failed to show "that this alleged advice was given by Dolkart or [his law firm] in a professional legal capacity," Parker said. "In severl instances, Dolkart arguably received information in his role as director of Gulf & Western or in his various other roles. For example, he was a member of the pension fund's investment committee and did not serve as its counsel."

"Because of Dolkart's many roles and the large amount of time he spent at Gulf & Western's offices, it cannot be assumed that all of his discussions with corporate officials involved legal advice," Parker continued. "Nor was evidence presented that the advice in question was confidential at the time it was given or that confidentiality has since been maintained."