The House, in a setback to the Reagan administration, voted, 229 to 193, yesterday to block the Defense Department from testing satellite-destroying weapons against objects in space as long as the Soviets do not conduct such tests.

The House approved a similar ban last year by a slightly larger margin but compromised with the Senate in agreeing to allow the Pentagon as many as three such tests this year. None has occurred, and the House action could halt them.

The Senate voted last month to allow unlimited testing of the weapons as long as President Reagan certifies that he is trying to negotiate an antisatellite treaty with the Soviets. But House lawmakers argued yesterday that pressing ahead with further tests would lead to a space arms race.

Differences between the House and Senate actions must be resolved in a conference. Lawmakers said a compromise similar to that allowing limited testing is likely to result.

In yesterday's vote, 31 Republicans and 198 Democrats approved the ban, while 148 Republicans and 45 Democrats opposed it.

The ban was adopted as an amendment to the $292.6 billion defense bill that sets spending limits for military programs in fiscal 1986. Among several other amendments approved was one providing an additional $1 billion for procurement of conventional weapons.

Armed Services Committee Chairman Les Aspin (D-Wis.) championed that as part of a Democratic alternative designed to show that Democrats are not anti-defense but favor reordering defense priorities toward conventional weapons.

Before adjourning last night, the House approved, 333 to 71, an amendment allowing the Defense Department to administer polygraph tests to employes with the highest national-security clearance and to applicants applying for those jobs. They would be asked in a polygraph test about espionage, sabotage, terrorism and unauthorized disclosure of classified information.

The House also approved, 364 to 51, an amendment that would allow the military to assist drug-enforcement officials by conducting arrests, searches and seizures outside the United States of those involved with drug trafficking. The proposal was offered by Rep. Charles E. Bennett (D-Fla.), whose son died of a drug overdose.

Still on the agenda were dozens of amendments, including one to prohibit introduction of U.S. combat troops in Nicaragua unless authorized by Congress or because of attacks on U.S. citizens or property and one to provide the death penalty for cases of peacetime espionage involving members of the armed forces.

The antisatellite (ASAT) weapons amendment, proposed by Reps. George E. Brown Jr. (D-Calif.) and Lawrence Coughlin (R-Pa.), would ban weapons tests against an object in space as long as the Soviets do not conduct similar tests of satellite-destroying weapons. The ban would take effect when Reagan signs the defense bill.

The House also adopted by voice vote an amendment by Rep. Steny H. Hoyer (D-Md.) providing $20 million for a study of ways to make U.S. satellites less vulnerable to possible Soviet attack.

The Soviets announced in 1983 that they would stop testing ASAT weapons and have said they would like to include an ASAT ban in ongoing arms talks in Geneva.

The Pentagon has tested various parts of its ASAT system and flight-tested it twice but has not targeted it against an object. The Air Force has said that the first such test is scheduled next month.

Supporters of the ban argued that a testing moratorium is needed to prevent militarization of space. They said a ban would make it easier to negotiate a treaty with the Soviets.

"It's in our best interest to accept the Soviet offer . . . not to test as long as they don't test," Brown said.

Opponents of the ban contended that the Soviets have a substantial advantage in that their ASAT weapons system is fully tested. The United States must catch up to protect its satellites and force the Soviets to negotiate seriously on an ASAT ban, opponents said.

"If you give up all your marbles before you get to the marble game, there isn't much chance of winning the marble game," Rep. Ken Kramer (R-Colo.) said.