Independent counsel Whitney North Seymour Jr. has sharply criticized the State Department for defending the diplomatic immunity of the Canadian ambassador whose testimony Seymour is seeking in the Michael K. Deaver perjury trial.

In a filing in U.S. District Court, Seymour said the State Department's "aggressive advocacy in this proceeding raises serious doubts about its own impartiality." He said the department was wrong in seeking to shield Allan E. Gotlieb, the Canadian ambassador to Washington, from testifying at Deaver's upcoming trial.

Accusing the State and Justice departments of "inaccuracies" and "erroneous claims," Seymour said: "Basic standards of justice and morality require the Canadian government to allow this key witness to come forward."

The trial of Deaver, the former White House deputy chief of staff charged with lying about his lobbying, has been postponed while he pursues a constitutional challenge to Seymour's status as a court-appointed prosecutor under the 1978 Ethics in Government Act.

Seymour touched off a diplomatic flap last month when a Federal Bureau of Investigation agent working for him tried unsuccessfully to serve a subpoena on Gotlieb and his wife, Sondra, at the Canadian Embassy.

"In attempting to construct a waiver of diplomatic immunity where none was given, {Seymour} is violating the terms under which our earlier cooperation was given," embassy spokesman John Fieldhouse said yesterday. "He is now attacking us for giving the very cooperation he requested . . . . He's tilting at windmills here."

The State Department stood by its earlier comments that "the attempt to subpoena Ambassador and Mrs. Gotlieb as a violation of both U.S. and international law."

Under an agreement last July, Gotlieb met informally with Seymour and responded to questions about Deaver. Seymour contends that this amounted to a waiver of diplomatic immunity and that the Canadian government had given the appearance of cooperation "to serve its own political interests at home." Fieldhouse called this "nonsense."

Seymour also argued that diplomatic immunity is more flexible than State Department legal adviser Abraham D. Soafer has contended.

"Once Allan Gotlieb gave written answers admitting his discussions with Deaver for use before the grand jury, he waived his right to claim diplomatic immunity to block his testifying at trial . . . . Only Mr. Gotlieb can supply the evidence necessary for a jury to determine whether {Deaver} lied under oath," Seymour said in the court papers.

Part of the five-count perjury indictment charges Deaver with lying about his involvement in White House meetings on acid-rain pollution before he resigned in May 1985 and became a paid Canadian lobbyist on the issue.

According to the indictment, Deaver falsely testified that he did not recall a Jan. 5, 1985, luncheon with the Gotliebs, which came as the United States and Canada were preparing for a summit at which acid rain was to be a key issue.

"The stark fact is that there are no available witnesses to testify about Deaver's crucial luncheon meeting," Seymour said. "Only four persons were present: Mr. and Mrs. Deaver and Mr. and Mrs. Gotlieb . . . . Mrs. Deaver cannot be expected to testify against her husband. That leaves exactly two witnesses: Ambassador Gotlieb and his wife."

The State Department is also opposing an attempt by Lawrence E. Walsh, independent counsel in the Iran-contra case, to subpoena testimony from former Israeli official David Kimche.