The House, responding to what one critic called the Reagan administration's "perverted" policy toward illegal immigrants from Central America, approved legislation yesterday to halt the deportation of immigrants from El Salvador and Nicaragua.

The measure would ban deportations for about two years while the General Accounting Office studies the status of Salvadoran and Nicaraguan immigrants in the United States and conditions in their countries. It would make such refugees eligible for legal employment but ineligible for most forms of federal assistance.

Ignoring administration objections, the House passed the bill, 237 to 181, on a largely party-line vote.

The Senate Judiciary Committee has approved a similar, temporary deportation ban. Such a provision was included in the House-passed version of sweeping immigration reform legislation last year but was deleted by a House-Senate conference committee.

The House bill, sponsored by Rep. John Joseph Moakley (D-Mass.), is aimed at protecting illegal Salvadoran immigrants from what critics said is an unfair administration deportation policy that protects only illegal Nicaraguan immigrants.

According to Rep. Chester G. Atkins (D-Mass.), the administration has granted political asylum to most Nicaraguan immigrants who apply but to only 3 percent of Salvadoran immigrants who apply. Attorney General Edwin Meese III announced this month that the Justice Department would encourage Nicaraguans to apply for asylum or deferral of deportation.

Atkins charged that the policy is ideologically driven, protecting Nicaraguans who have fled the Sandinista government, which the U.S. government opposes, but not immigrants from El Salvador, which is also in turmoil after years of strife between right-wing forces and the U.S.-backed government.

"America has proudly been a place of sanctuary for those in danger," Atkins said. "The Reagan administration has perverted this principle, turned it on its head."

He added, "You run because your life is in danger. Whether the fear is from the left or the right should make no difference. Our asylum policy should be ideologically neutral."

Rep. Esteban E. Torres (D-Calif.) said "the issue is one of equity."

"There is no real difference in the dangerous conditions under which these people are forced to live" in El Salvador or Nicaragua, he said.

Opponents of the bill argued that it would begin to unravel the recently passed immigration law. They also charged that most Salvadoran immigrants in the United States are here for economic reasons rather than fear of violence or persecution.

Rep. Patrick L. Swindall (R-Ga.) said that for the last 30 years, El Salvador has ranked second only to Mexico as a source of illegal immigrants to the United States. "What brought these people here is the same thing that has always brought them here -- jobs," he said.

Rep. Hamilton Fish Jr. (R-N.Y.) said Salvadoran refugees faced no threat of "mass deportation" and that civilian deaths from fighting in El Salvador have "declined dramatically" since 1980.

Although the bill would allow state and local governments to deny most welfare benefits to the immigrants, opponents say public assistance to the immigrants could cost $20 million to $30 million next year.

The Congressional Budget Office estimated 300,000 to 500,000 Salvadoran and Nicaraguan immigrants could be affected.

Under the measure, they would have 180 days after enactment to apply for special status.