A federal judge in Alexandria yesterday threw out the last 14 counts of a major fraud case against Computer Sciences Corp., ruling that prosecutors improperly permitted five people, including an air-conditioning maintenance man, to enter a grand jury room.

Judge Richard L. Williams also dismissed charges against one company executive on grounds of governmental misconduct.

Yesterday's action abruptly ended a 57-count indictment brought by prosecutors last year against the California-based firm, a major supplier of computer software to the federal government, and six individuals. The case was an outgrowth of a lengthy criminal investigation of corruption in the General Services Administration.

Williams, acting on a pretrial motion by defense attorneys, said he was dismissing the 14 charges "without prejudice," meaning that prosecutors are free to attempt to bring new charges if they want.

Prosecutor William S. Lynch said he was unsure whether he would recommend an appeal of the ruling.

"If they had only knocked on the door, and the prosecutor had gone outside, this would not have happened," said Barry W. Levine, a defense lawyer, after the ruling. But "people were going in [the grand jury room] like it was back to the days of the Star Chamber," said defense attorney David R. Addis, who argued with Levine for dismissal. They claimed that the lax security made it impossible for their clients "to know who their accusers were."

During yesterday's 48-minute hearing, Williams said three U.S. marshals, an unidentified woman and a maintenance man checking on air conditioning walked into the grand jury room on five separate occasions during the 1979 and 1980 sessions that preceded the indictment.

The marshals delivered unidentified papers, the woman delivered papers and spoke with a prosecutor, and the maintenance man was checking on complaints of 78-degree temperatures in the room, Williams said.

Federal rules prohibit unauthorized persons from entering a grand jury room while the panel is in session.

"The government has absolute control of the grand jury process," Williams said. "There is no way to get into the grand jury room unless the government is avoiding its duty. Probable prejudice to the grand jury system exist" when unauthorized people walk in the out, he said.

Williams also threw out charges against Norman W. Derrick, a company official, saying prosecutors improperly told Derrick he did not need to be represented by a lawyer when he testified before the grand jury. The prosecutors continued to call on him for information for nearly one year, until he was indicted with the others last October, Williams said.

Derrick didn't know "he was walking around with the enemy. He didn't realize what he was doing would come back to haunt him," Williams ruled.

The computer company was charged in the original indictment with conspiracy to bribe a General Services Administration contracting officer during negotiations over a $100 million computer time-sharing contract. oShortly after the company won the contract it hired the former GSA employe through a Lichtenstein subsidiary, the indictment alleged.

The company also was accused of illegally boosting its prices by more than $14 million in its dealing with the federal government.

On Jan. 7 Williams dismissed 43 counts of racketeering, mail fraud and wire fraud against the company and individuals. The 14 counts dismissed yesterday centered on government allegations that the company had falsely overbilled the government for millions of dollars worth of services it provided.

The individuals named in the original indictment were Erwin Allen, Thomas A. Marti, Peter C. Loux, John W. Luke, and Derrick, all current or former company employes, and Herbert G. Blecker, head of Icarus Corp., a company subcontractor.