A Maryland judge today ordered a second official of a Virginia-based anticommunist foundation to appear before a California grand jury investigating allegations that confidential Los Angeles police intelligence files were leaked to the foundation.

The order, by Baltimore City Circuit Judge Robert L. Karwacki, directing John Rees, editor of the Western Goals Foundation newsletter, who lives in Baltimore, to go before the Los Angeles grand jury follows a similar order two days ago by a Virginia judge against Western Goals director Linda Guell.

The Western Goals Foundation is a research and publishing organization in Alexandria founded in 1979 by Larry McDonald, the arch-conservative Democratic congressman from Georgia and John Birch Society chairman killed in the Korean Air Lines jet shot down by the Soviet Union on Sept. 1.

Western Goals attorneys, who had fought the subpoenas against both Rees and Guell, said they are considering appeals.

In a surprise move in the bitterly fought case today, attorneys for Rees asked Los Angeles Police Det. Ben Lovato if he had threatened to kill Rees earlier this week when Lovato was with Guell in Alexandria.

"Didn't you say, 'I would like to kill John Rees,' or words to that effect?" asked attorney James G. Maggio. "No," answered Lovato. Judge Karwacki stopped further questioning on the issue. Lovato declined later outside the courtroom to discuss the allegation.

The subpoenas against Guell and Rees stem from a grand jury investigation led by Los Angeles County prosecutors into whether Los Angeles Police Det. Jay S. Paul funnelled secret police dossiers and other materials on alleged leftwing and rightwing radicals and organizations into a Western Goals computer.

Lovato testified today that Paul, a longtime member of the police department's now-disbanded Public Disorder Intelligence Division, had a $30,000-a-year contract with Western Goals to program a Western Goals computer at his wife's law office in Long Beach, Calif., and enter data into it relating to antinuclear protests, terrorism and other subjects.

Lovato said some of the data originated from public sources, such as the New York Times, but there was also information from the police department's intelligence files.

Lawyers for Rees argued that all the data originated from public sources. They also contended that Rees, an accredited reporter who is Washington correspondent for John Birch Society publications, should be exempt from revealing whatever information he may have under the Maryland state reporter's "shield law." California has no such law.

Since the information Rees may have is in the public domain, the attorneys argued Rees is not a "material" or "necessary" witness for the grand jury and his being forced to go to California would be an "undue burden" -- all legal arguments for throwing out the subpoena.

Karwacki ruled, however, that Lovato had shown a sufficient need for Rees to appear before the grand jury to determine if unauthorized police records did reach Western Goals.