Legislation to suspend the deportation of up to 700,000 Nicaraguans and Salvadorans who are now illegally in the United States was approved yesterday by the Senate Judiciary Committee.

The 9-to-2 vote follows a controversial move by the Reagan administration last week to grant liberalized immigration status only to the estimated 150,000 to 200,000 Nicaraguans living in this country. Critics of the move have complained that economic and social conditions in Nicaragua and El Salvador are equally bad, but that the administration has singled out Nicaraguans for favorable treatment because it wants to embarrass the Sandinista government, which it opposes.

"In El Salvador, you have a civil war ongoing, an earthquake, people living in refugee camps, and unemployment of over 50 percent," said Rep. John Joseph Moakley (D-Mass.), sponsor of a bill similar to the one approved by the Senate Judiciary Committee yesterday. "This government is crazy . . . If El Salvador were under communist leadership, we'd have the welcome wagon out and waiting for them to land."

Moakley's bill was approved two weeks ago by the House Judiciary Committee and is expected to reach the House floor later this month.

The major opposition to the Senate bill came from Sen. Alan K. Simpson (R-Wyo.), chief author of the sweeping new immigration law signed by President Reagan last November, who said he agrees that conditions are bad in El Salvador and Nicaragua but is concerned this change could upset the delicate balance of the new law.

"If you resist any of this, you're {considered} a mean, hard-hearted Hannah," Simpson said. "We're just too darned compassionate in this country . . . that's our strength and our weakness . . . it distorts what we are doing."

In response to questioning from Sen. Dennis DeConcini (D-Ariz.), the bill's sponsor, Simpson said that neither Nicaraguans nor Salvadorans should receive special status. That had been the administration's position until its announcement last week.

It is not yet clear what the order, signed by Attorney General Edwin Meese III, will mean to Nicaraguans. The order said that Nicaraguans "with a well-founded fear of persecution" from the leftist Sandinista government will be allowed to stay in this country.

One Justice Department source said that whatever the language of the order, there is a strong feeling in the department that "we should not send them back" to Nicaragua.

Sen. Edward M. Kennedy (D-Mass.) called the Meese order a "rather phony document" that basically restates current laws. But Kennedy charged that even before the order, Nicaraguans were receiving preferential treatment. He said that 88 percent of requests for political asylum from Nicaraguans are being approved by the Immigration and Naturalization Service, while the INS grants asylum to only about 3 percent of the Salvadorans who apply.

Asylum requests are normally handled by INS on a case-by-case basis, while the bill would apply special status to two nationality groups.

The U.S. government has given special immigration status, known as extended voluntary departure, to certain groups of aliens, including those from Poland, Ethiopia and Afghanistan who have come to the United States to avoid war or persecution in their home countries. Without that or some other special status, the illegal aliens from Nicaragua and El Salvador face immediate deportation if they are caught by the INS.

In May, the administration turned down a plea from Salvadoran President Jose Napoleon Duarte that thousands of illegal Salvadoran refugees not be forced to return to his country. He said the Salvadoran economy would be even further disabled because so many of the refugees send U.S. dollars to relatives in El Salvador. The administration refused the request because it feared such a move would suggest that the Duarte regime, which Reagan supports, is unstable.

The INS has estimated that there are as many as 500,000 Salvadoran aliens living illegally in the United States.