The House of Representatives passed without debate yesterday a measure that would permit military courts to impose the death penalty on those convicted of espionage in peacetime.

The approval of the measure by voice vote was the House's second action in less than 24 hours to strengthen anti-espionage efforts following the recent arrests of four alleged Navy spies.

Yesterday's vote represented a dramatic turnaround for the House, which last year refused to take up a Senate-passed measure that would have allowed the imposition of the death penalty in cases of espionage, treason and attempts on a president's life.

The vote followed overwhelming House approval Wednesday night of a measure that would allow the Defense Department, for the first time, to test the loyalty of more than 4 million military and civilian employes with access to classified information through the use of polygraph tests. It would require polygraphs before employes are allowed to see the most sensitive information.

Proponents and opponents of the two measures agreed yesterday that neither would have passed so easily had it not been for mounting concern over the alleged spy ring said to be headed by retired Navy Chief Warrant Officer John A. Walker Jr. Federal officials have described the spy case as one of the most damaging in decades.

Voicing a sentiment widely shared by civil liberties advocates, Rep. Don Edwards (D-Calif.) said the House was acting out of "hysteria. That's the only reason these worthless amendments are being adopted, and it's really shameful that it's going on like this."

Supporters of the measures in Congress and in the Pentagon said House members were simply seizing on the long-awaited chance to institute much-needed improvements to protect national security.

"With these kinds of opportunities opening up to us, opportunities that were closed previously, we will be able to do a much better job insofar as the protection of our security and classified information," said Adm. Ron Hayes, deputy chief of naval operations, in a speech yesterday at a naval symposium in Virginia Beach.

Rep C.W. Bill Young (R-Fla.), who sponsored the lie-detector measure that passed Wednesday night, said the House votes reflected widespread dismay over a series of "attacks on the American system and the American way of life," of which the hostage situation and the Walker case are the most recent.

"I think if you add up the accumulation of the emotions of the American people, they're tired of hijacking, they're tired of terrorist activities. They're tired of Americans turning traitors and selling secrets," Young said in an interview.

The lack of opposition on the House floor to the death penalty measure took even its sponsor, Rep. Bill McCollum (R-Fla.) by surprise.

"When things come over from the Senate dealing with the death penalty the House doesn't even hold hearings on them," said McCollum, who introduced his measure on the floor as an amendment to the House defense appropriations bill.

Prospects for the measure in a House-Senate conference, where it will be taken up next, were uncertain yesterday.

McCollum said the chances would be better if he had been able to force a recorded vote on the measure, because conference committees tend to treat amendments adopted by voice vote less seriously.

One well-placed congressional source predicted that the lie-detector measure, also passed as an amendment to the defense authorization bill, would fare better than the death penalty proposal in conference. The Senate version of the bill has no death penalty provision, and would simply extend a relatively small pilot program for polygraph tests.

McCollum's measure would allow the imposition of the death penalty only for those convicted of espionage in military courts, which usually lose out to civilian courts for spy trials. The most recent spy case tried in military court took place during the Korean War in the early 1950s, McCollum said.

But proponents hailed yesterday's vote as a step toward reinstituting the death penalty as a possible punishment for all espionage cases in civilian and military courts alike.

A measure that would cover both types of cases is pending in a Senate Armed Services subcommittee. Its sponsor, Sen. Phil Gramm (R-Tex.), said yesterday that he was "delighted" with the House action and planned to move quickly for a vote on his bill.

The maximum punishment for espionage during peacetime now is life imprisonment in civilian courts and 10 years in prison in military courts.

Death penalty statutes are on the books for crimes of espionage during wartime, but a 1972 Supreme Court decision has apparently rendered them unconstitutional.

Allan Adler, legislative counsel for the American Civil Liberties Union, said yesterday the death penalty measures would not solve "the real problem with espionage -- that there are far too many documents that are classified and far too many people with access to them.

"It's doubtful that the death penalty will serve any real deterrent value and I think the same could be said for the polygraph," Adler said.

But McCollum told his colleagues that the federal government was behind the states in reinstating death penalty laws, adding, "I can think of nothing that's more dramatically demonstrated the need to rectify the laws . . . than the Walker espionage case.

"I think it would probably be very embarrassing for anyone to vote against this."