A federal judge, granting a request by the Justice Department, ruled yesterday that former Environmental Protection Agency administrator Anne M. Burford does not have to testify before an Alabama grand jury investigating the state's chemical-waste industry.

U.S. District Court Judge Albert V. Bryan Jr. in Alexandria raised questions about the Justice Department's reasons for blocking the subpoena of Burford, saying that "it seems to me the federal government would have just as much interest" in allegations of corruption at the EPA. But he ruled that state prosecutors had not shown sufficient cause that Burford was a necessary and material witness in their investigation.

James H. Evans, district attorney of Montgomery County, Ala., said the Justice Department's argument "smacks of presidential privilege."

The case has thrown Burford and Justice Department attorneys together on the same side, although the former EPA chief repeatedly has criticized the department for advising her to withhold documents from Congress in the 1983 controversy that led to her resignation.

Evans is investigating the allegedly illegal transfer, storage and burning of hazardous wastes in Alabama. He said Burford is a key witness as to how an EPA permit was changed to allow Chemical Waste Management Inc. to burn pesticide wastes "laced with dioxin" aboard its incinerator ship, the Vulcanus. Evans said the permit was altered to allow a more lucrative commercial burn rather than one for research alone.

A 1983 Justice Department probe found that James W. Sanderson, a former Burford aide who represented Chemical Waste Management, discussed the company's permit application with Burford after he left the EPA, thereby helping to speed its approval. The department declined to bring charges against Sanderson.

"Let's talk to the lady that was being advised by Mr. Sanderson," Evans said, referring to Burford. " . . . We don't understand how the permit changed in the middle of the night." He said he had not decided whether to seek Burford's deposition in Washington.

Justice Department attorney Wayne R. Walters said, "I want to make it perfectly clear . . . in no way do we want to impede what is lawful." Citing the earlier probe of Sanderson, he said, "We believe these matters have already been investigated."

The case attracted a prominent Burford adversary. Halfway through the hearing, former Burford aide Rita M. Lavelle walked into the courtroom and sat behind Burford in the first row.

After the judge's ruling, Lavelle, who as EPA assistant administrator headed the U.S. hazardous waste cleanup drive, said: "I can't understand what the Justice Department has to hide . . . . What does she [Burford] have to hide? If we are public servants, we should be willing to explain what we did in office."

Lavelle, who recently completed a jail term for perjury and obstruction of justice, did not speak to her former boss. As Burford passed her in the hallway, Lavelle said she would willingly appear before the Alabama grand jury next week.

Evans' probe has centered on Chemical Waste Management's massive landfill near Emelle, Ala., which stores wastes destined for the Vulcanus. The probe has gained widespread publicity because James Parsons, the son-in-law of Alabama Gov. George C. Wallace (D), receives royalties on business done at the Emelle dump site.