The Senate Foreign Relations Committee voted yesterday to bar all U.S. military advisers and assistance from El Salvador unless President Reagan certifies that the government there is complying with six conditions intended to promote democratic reform and prevent human rights abuses.

In voting the restrictions on aid to El Salvador's military-civilian junta, the Republican-controlled committee turned aside a last-minute appeal from Secretary of State Alexander M. Haig Jr., who contended the legislation would be detrimental to the conduct of U.S. foreign policy.

However, the committee did back the Reagan administration in its desire to take an important policy initiative toward another controversial Latin American military regime. It voted to rescind four-year-old legislation that has barred the United States from supplying military aid to Argentina.

The El Salvador amendment, offered by Sen. Christopher J. Dodd (D-Conn.) to the pending foreign aid bill, paralleled legislation adopted by the House Foreign Affairs Committee April 29.

If these amendments are passed by the full House and Senate and relatively minor differences are reconciled in conference, President Reagan will be required to certify every six months that Salvadoran authorities are meeting the conditions laid down by Congress.

Although the El Salvador aid restrictions are still a long way from law, the actions of both committees have been a clear sign that doubts about Reagan's support for the junta's war against leftist guerrillas are alive on Capitol Hill and that members of Congress want greater assurances about the administration's firmness in pushing for reform in the Central American country.

In broad outline, both the Senate and House amendments would require Reagan to certify that the Salvadoran government is working to end human rights abuses, is trying to gain control over its security forces, which have been charged with widespread murder and torture, and is committed to continuing economic and social reform and to holding free elections.

The amendments also require presidential certification that the junta is willing to negotiate a political solution with opposition factions and is making a good-faith effort to solve the murders of four American Roman Catholic women missionaries and two American advisers on agrarian reform.

In yesterday's action, eight Democrats and three Republicans voted for Dodd's amendment. The only negative vote was by Sen. Richard G. Lugar (R-Ind.).

Shortly before the vote, Haig sent a letter to the committee urging that the amendment be rejected on grounds it would tie the administration's hands in conduct of foreign policy.

However, Dodd noted that all of the conditions are in accord with what the administration says are its goals in El Salvador and that the language of his amendment had been worked out in consulation with some Republican committee members.

The action on Argentina, on an 11-to-1 vote, eliminates the ban on military aid and allows such assistance to be provided if the president certifies the Argentine government has made "significant progress" toward respect of human rights and that the aid is in the U.S. national interest. Only Sen. Nancy Landon Kassebaum (R-Kan.) voted against.