When the District of Columbia gave a surprise test for marijuana to a class of 165 police recruits last month, it joined a small but growing number of employers who test workers for evidence of America's most widely used illegal drug.

The development of a new urine test for marijuana -- a drug used by about 23 million Americans and sampled by more than 50 million, according to government estimates--has raised legal, philosophical and technical questions about the need to balance an employer's right to run a safe and productive work place as opposed to an employe's right to privacy and due process of law.

Advocates of expanded testing, primarily the private American Council on Marijuana and officials of the government's National Institute on Drug Abuse, predict the tests will become widely used in work places, especially where safety is crucial. Eventually, they say, testing may spread to school systems.

Critics, such as the National Organization for the Reform of Marijuana Laws (NORML) and the American Civil Liberties Union, argue that the tests should be used only in limited circumstances, because of what NORML calls "frightening" opportunities for misuse.

Introduced commercially in 1980, the tests have become more widespread since last September when they were first marketed in "portable" kits that can test 100 persons at a cost of $1 to $2 each.

The urine tests -- which are reported to detect marijuana use as far back as 14 days -- have been used primarily by the Department of Defense, by medical examiners and by various prison systems, parole programs and drug-treatment centers, according to Dr. Richard Hawks, chief of research technology at the National Institute on Drug Abuse.

The institute funded research by the SYVA Co. of Palo Alto -- the firm that now markets the only commercially available test, called EMIT. D.C. officials used the EMIT test on the police recruits.

Work place testing has "taken off" in recent months, Hawks said, "because I guess it's just taken a while for people to hear about it."

In most cases, the urine tests are compulsory under company rules, but have been used selectively rather than as part of any mass screening, according to those familiar with the field. Major firms have begun using it. For example:

* Washington Gas Light Co. employed a urine test for marijuana for the first time last month after an anonymous caller reported seeing four workers parked in two company trucks at a D.C. roadside, apparently smoking marijuana. The employes, who faced firing if they refused the urine test, gave samples that afternoon, according to Washington Gas spokesman Paul Young.

Two workers tested positive, were suspended without pay and now face dismissal, Young said. The International Union of Gas Workers plans an appeal, although union vice-president William A. Coles said he is unsure of the workers' rights because "we've never dealt with this before."

* Lockheed Missile and Space Co. fired five workers at its Charleston, S.C., plant last fall after urine tests during annual physical examinations showed marijuana use. "These were people who handle explosives . . . and we generally look at marijuana as grounds for termination" whether on the job or off, said plant manager Chuck Myers. Dale Cobb, a Charleston lawyer affiliated with NORML, said several workers were "indignant" over the testing and considered a challenge on the grounds that the tests are "not very reliable" and that the testing itself invades their privacy.

* Ford Motor Co. began urine tests for marijuana several weeks ago among 30,000 assembly-line workers at its massive River Rouge plant in Dearborn, Mich. A Ford spokesman said the test is used only after supervisors observe erratic behavior, and that workers are not fired unless the drug use contributes to excessive absenteeism. A UAW spokesman, who was not aware of the testing, said it has not yet drawn complaints from the Rouge local.

* Southern Railway System introduced the test about a year ago after the Washington-based railroad added marijuana to the list of banned substances under terms of the railroad's 150-year-old "Rule G," which originally called for the immediate firing of any rail operator found under the influence of alcohol.

Southern since has discontinued the marijuana testing after learning that the urine test could not prove intoxication, but only the presence of an undetermined amount of the drug ingested at an undetermined time, according to Dr. Max Rogers, the railroad's chief surgeon.

While the number of companies using the tests is small, many others appear ready to "jump on the bandwagon" once the legality of the testing is decided, according to Jack Erdlen, executive director of the Employment Management Association, a Massachusetts-based group representing personnel executives of major corporations.

The urine tests, according to researchers, are considered accurate up to 10 days, possibly 14. Current technology, however, can measure neither the quantity used nor whether the user was actually "high" on the drug.

In addition, conflicting claims about accuracy have arisen: Commercial drug manufacturers and NIDA claim 95 percent or higher accuracy; the military says it has a virtually foolproof testing method; and critics charge that the tests are far less accurate and also can wrongly finger someone who "passively inhaled" marijuana fumes, for instance at a party or a rock concert.

Human error can be a factor as well. In the D.C. police case, in which 39 tests were positive initially, recruits alleged that bottles containing the samples were mislabeled, misplaced and possibly switched, and Chief Maurice T. Turner acknowledged Thursday that the tests had been mishandled. He then reinstated 24 of the recruits.

The Defense Department has been the major user of drug-testing technology since President Nixon in 1971 ordered a detection program to stem heroin use among soldiers in Vietnam. No test for marijuana was available then and the military began field testing only last fall, after several years of research.

Only since Feb. 1 have the tests been used as the basis for discipline or discharge of soldiers, according to John H. Johns, assistant secretary of defense for drug and alcohol abuse prevention. Johns, in an interview, said the military will conduct as many as 1.5 million drug tests this year, most for marijuana.

The U.S. Court of Military Appeals in 1980 overturned earlier decisions and, in effect, ruled that DOD had the right to compel urine tests for drugs. Military courts have not yet been asked to rule on whether such tests can be used to discipline or discharge officers, Johns said.

"I think we will have some real court tests in the civilian sector, though, because you are not measuring impairment on the job in these tests, You are dealing with off-duty life too," Johns said. "Police departments may have their rights upheld to discipline anyone caught smoking off-duty , but I don't know how it will stand up" in civilian jobs.

The Defense Department uses two portable urine-testing kits, EMIT and another known as radioimmunoassay, or RIA, produced by Hoffmann-La Roche Inc. of Nutley, N.J., specifically for use by Defense. Before using either test for disciplinary purposes, however, the military double-checks any "positive" readings with a newly perfected gas-chromatography method that Johns calls "reliable to the nth degree."

Some military commanders order massive "unit sweeps" to test everyone, while others test only those soldiers acting disoriented, Johns said. Johns, a retired brigadier general, said he favors spot-checking only because mass tests can be expensive and, more importantly, "bad for morale."

Proponents of marijuana testing argue that it is a valuable tool to assure public safety, especially among workers in sensitive jobs such as police and firefighters, military personnel, airline pilots, bus drivers, railroad employes, utility workers -- particularly in the nuclear industry -- and many others.

"For the first time, there is an easy, affordable way to determine whether someone is using marijuana . . . and companies will have to face it. The public is going to eventually demand it," said Dr. Robert L. DuPont, former director of the National Institute on Drug Abuse and a leading advocate of increased testing.

DuPont, a psychiatrist who now is president of the American Council on Marijuana, is a leading advocate of testing in the nation's schools. None has yet done so, he said. "Marijuana and learning are not compatible, and marijuana use spreads from friend to friend," DuPont said. "It should be treated like chicken pox." Hawks said some pediatricians already use the test at parents' request.

Critics say the tests may be justified in cases where employers have probable cause to suspect drug use and where that drug use effects job performance. But they argue that the tests give employers a dangerous weapon to intrude on workers' private lives and punish them.

Kevin Zeese, executive director of NORML, said the increased testing is part of a "backlash" against the decriminalization of the drug that has occurred in 11 states and said he sees "frightening" implications, especially for schools.

"Let's say you have a 15-year-old kid, at the time of his life of experimentation, and he tests positive based on a single use. They will likely end up throwing him in a drug rehab project," he said.

Zeese acknowledged that many employers have legitimate concerns about employes who might be "stoned" during work, but he said the 10-day or longer lifespan of the test makes it likely that persons could be punished for off-duty or weekend drug use.

Generally, employers have the right to conduct such urine tests, according to Arthur Spitzer, legal director of the ACLU's Washington office, "although we might suggest it is unnecessarily intrusive into the private lives" of employes. In labor-management arbitration cases, employers trying to fire workers for using marijauna usually must demonstrate that it effects job performance, he said.

Robert E. Smith, an attorney who publishes the monthly "Privacy Journal," compared the urine testing to employers' use of lie-detector tests because of the potential invasion of privacy. Polygraph testing has been banned as a condition of employment in 17 states and the District of Columbia.