The Reagan administration's plan to conduct random drug testing of all 13,000 federal prison workers was blocked by a federal judge who says it "treats innocent employees as suspects."

U.S. District Judge Stanley Weigel, whose earlier order had blocked the program from starting as scheduled May 23, issued a preliminary injunction Thursday rejecting the government's claims that drug testing was justified by concerns about safety and corruption.The administration will appeal the ruling immediately and ask the 9th U.S. Circuit Court of Appeals to let testing begin while the appeal is pending, said Assistant U.S. Attorney George Stoll.

The Bureau of Prisons was to have been one of the first agencies to begin drug testing under President Reagan's September 1986 executive order for testing of federal employees in "sensitive" jobs. The bureau has declared that all of its workers hold sensitive jobs.

"The program would force law-abiding employees of the Bureau (f Prisons), on two hours' telephone notice, to submit to urinalysis testing even though not suspected of any drug use or of any wrongdoing, negligence or dereliction of duty," Weigel said in response to a suit by the American Federation of Government Employees, the largest federal workers union.

"There are cases in which compulsory drug testing may be justified in the interest of public safety or security or the like. This is not one. Rights guaranteed by the Constitution of the United States must not bend to public clamor."

He said the administration's stated justifications of safety, prevention of corruption and preservation of public confidence were unsupported by any evidence that problems in those areas had been caused by employee drug use or would be reduced by random testing.

While drug use in society is a serious problem, the judge said, random testing of innocent employees, without a showing of individual suspicion or some compelling interest of the government as employer, is not a constitutional response.