A federal judge cleared Virginia yesterday of charges that its State Police discriminated against blacks in hirings and promotions, rejecting Justice Department arguments that the paucity of blacks on the force was a product of systematic racial bias.

U.S. District Judge D. Dortch Warriner, who once remarked that the force's ability to recruit blacks and women was "admittedly" poor, did rule that Virginia had discriminated against women, a point the state did not contest.

When the Justice Department began to pressure Virginia officials to settle the dispute out of court, the state had 11 blacks and no women on its 1,112-member force. A state official said yesterday there are now 31 blacks and seven women on the force, although almost half of the 61 blacks hired since 1973 when a Justice Department investigation of the force began, have quit.

Warriner's ruling that the state has not been biased against blacks was a victory for both former governor Mills E. Godwin and his successor, Gov. John N. Dalton, who had repeatedly rejected pressure to settle the suit out of court. Maryland and several other states have settled similiar suits out of court by agreeing to improve minority hiring efforts.

Justice Department lawyers contended that the 11-day trial of the complaint against Virginia produced evidence of "gross instances of discrimination." White police investigators would pry into the sexual habits of black applicants and subject them to unwritten "vague standards" that white applicants seemed to avoid, said William White, a Justice lawyer.

Application forms of black police candidates were not marked by race, but were coded by red comma's used after the applicants names. Virginia's lawyers did not dispute the use of the red commas or some of the Justice Department lawyers, but said the cases were isolated and did not amount to "one ounce of prejudice."

Warriner, a conservative judge from Southside Virginia, seemed to agree frequently with the state's positions during the trial and his long opinion, released yesterday, took the federal government to task for its role in the case.

". . . It would appear from the very bulk of the evidence in this case and from the many allegations of racial discrimination, that there must be some racial discrimination practiced by members of the Virginia State Police." Warriner wrote. "Where so much smoke is found, it is hard to believe there is no fire.

"Thus the fact that the [Justice Department's] evidence is in fact so scarce weighs heavily with the court. The inability to glean more than this from a record which is no less than five feet thick bolsters the court's view that the Virginia State Police have not engaged in a pattern or practice of purposeful racial discrimination sice the effective date of" the 1973 Crime Control Act.

"We've been given a clean bill of health," Virginia Attorney General J. Marshall Coleman said yesterday. "This was a complete victory for the state. There is nothing we have lost."

A Justice Department spokesman in Washington declined yesterday to comment on the decision. When Warriner ruled against the department earlier on the question of a federal aid cutoff to Virginia, the department successfully appealed his ruling to the 4th U.S. Circuit Court of Appeals and later won the cutoff of federal funds to the police force.

The Justice Department claimed that a written test once given to all trooper applicants discriminated against blacks and that the score needed to pass the exam was too high.

Warriner disagreed. "The court believes that the investment necessary to train a state trooper is great enough to justify a cutoff score which would minimize the number of . . . (failures) and thus save the people of the commonwealth a substantial sum of money." Warriner said the government "has not proven that the use of the written test, although valid, was in fact a subterfuge for racial discrimination."

The department also contended that a disproportionate number of black trooper applicants were weeded out through subjective background investigations using factors such as credit ratings, cohabitation, venereal disease and illegitimacy.

"The fact that consideration of these factors may weight more heavily against black applicants than against white applicants (a fact not proven by the evidence in this case) does not by itself invalidate these questions as unlawful and discriminatory practices," Warriner said.

"The background investigations and the decision to hire or not based . . . so far as the court can discern, are free from racial taint or bias," Warriner said. "Every applicant accepted for employment as a state trooper can be assured that he or she meets the same high standards as his fellow troopers unblemished by racial consideration."

Warriner said he was impressed by the testimony of the first woman state trooper in Virginia, Cheryl L. Nottingham, who said she was not subject to discrimination because of her sex and said she saw no discrimination against black troopers by instructors in her training class.

"She indicated they were hard on everybody," Warriner said.