A federal judge upheld yesterday a massive FBI search of two large Church of Scientology headquarters buildings in Los Angeles last July 8, claiming it was "reasonable and properly limited" although directed at a religious organization.

If upheld on appeal, the ruling clears the way for federal prosecutors to present documents seized in the Los Angeles raid to a federal grand jury in Washington. That jury is investigating alleged criminal activities by members of the church's hierarchy.

U.S. District Judge Malcolm Lucas delayed the effectiveness of his order for 24 hours to give church attorneys time to seek immediate action by the U.S. Court of Appeals that could block further use of the documents in the federal investigation.

Church officials immediately denounced Lucas' ruling, saying it means the "police or FBI can now smash their way into any group formerly protected by the First Amendment, wander about at will and search through every piece of paper in a massive but authorized fishing expedition."

Federal prosecutors have said the church's highest officials are under investigation for allegedly directing a widespread conspirarcy to place church operatives in federal agencies commit burglaries to obtain government documents, wiretap at least one government meeting and obstruct justice by having a Scientology Church member to a grand jury investigating a government break-in.

Church officials have issued statements saying they expect several of their leaders to be indicted.

The ruling by Judge Lucas is the latest in a series of court actions that began while FBI searchers were poring through Scientology files at the church's headquarters in Los Angeles and Washington last July 8.

The [WORDS ILLEGIBLE]warrant was based on a detailed affidavit recounting testimony by a former Scientology official in which he said the church's highest officials were directing a massive campaign of [WORDS ILLEGIBLE]burglary and harassment against several federal agencies.

The warrant had been signed on July 4, 1977. Over the next three days, the FBI and federal prosecutors made preparations for the actual search - one of the largest in FBI history, involving more than 100 agents who entered church offices looking for evidence of an alleged criminal conspiracy.

While th search was in progress, Scientology attorneys unsuccessfully asked federal judges to halt it.

Almost immediately, however, they brought civil actions in Washington and Los Angeles to have the search warrant ruled unconstitutional and to have the hundreds of thousands of documents that had been seized returned. Scientology criticisms of the raid ranged from the wording of the warrant to the manner in which the raid was carried out by the agents.

U.S. District Chief Judge William B. Bryant in Washington ruled in favor of the church concerning the wording of the warrant, saying it amounted to an unconstitutional "general warrant" that gave the searchers too much leeway in what they could seize.

Judge Lucas who had the same issue before him in Los Angeles, postponed ruling on it pending the outcome of an appeal by the government of Judge Bryant's ruling.

The U.S. Court of Appeals in Washington, in a ruling upheld by the Supreme Court reversed Judge Bryant and said the warrant was legal.

Since that ruling, the Scientologists have been pressing their contention that the FBI agents used excessive force and followed improper search techniques in conducting what the church says amounted to a rummaging of files protected by the First Amendment.

Judge Bryant has conducted hearings on that issue in Washington concerning the search of the church's Dupont Circle headquarters here, but those hearings have been in recess for several weeks.

Meanwhile hearings on the same basic issue - only concerning church headquarters at the old Cedars of Lebanon Hospital and Fifield Manor, both in Los Angeles - were conducted by Judge Lucas and resulted in yesterday's ruling.

During the hearings before Judge Lucas last month, it was disclosed that Scientology documents seized during the Los Angeles raids described a special filing system with the code name of "Red Box" to conceal, in the Scientologists' words, any "proof that a Scientologist is involved in criminal activities."

A further inventory of the documents seized in the raid showed that the church, in an effort to investigate and attack its "enemies" kept files on judges, politicans, and groups such as the Better Business Bureau. Included in the files were orders from top Scientology officials to investigate and attack certain government agencies, private businesses and individuals, according to the documents.

The inventory of the contents in the seizure, filed in court in Los Angeles, also showed that the church files contained memos on how to obtain false identities and to tap telephones. They also contained a lockpicking kit, electronic eavesdropping equipment, two pistols and a blackjack.

The disclosure of information in the seized documents has prompted renewed legal efforts by Scientology attorneys to have the documents returned to them, saying they are being improperly made public by federal investigators.

The Scientologists have contended that numerous government agencies have conducted a 20-year campaign to infiltrate and harass the organization in violation of the First Amendment. They say the current federal investigation into alleged illegal break-ins and buggings by the Scientologists is only the latest and most visible act by the government against them.

Scientology, founded by L. Ron Hubbard, professes to be a religion in which people can be "cleared" of troubling experiences through sessions with church "auditors" or counselors.The church claims 3 million members in the United States.