The United States, reacting to the murder of four American women in El Salvador, yesterday suspended more than $25 million in military and economic aid and announced that President Carter is sending a special mission to that Central American country to investigate allegations that Salvadoran security forces were involved in the killings.

A White House announcement last night said the commission would leave this morning and report its findings to the president next week. Heading the mission will be William D. Rogers, a former undersecretary of state for economic affairs and former assistant secretary for inter-American affairs, and William G. Bowdler, the current assistant secretary in charge of Latin America.

State Department spokesman John Trattner, who announced the aid suspension, was careful to say that the department's information so far is fragmentary and based on press reports. In private, though, senior U.S. officials said there was virtually no doubt that Salvadoran security forces were implicated in the slaying of the three Roman Catholic nuns and a lay social worker on Tuesday.

These officials said the killings, which occurred a few days after the murder of six leaders of the leftist Democratic Revolutionary Front, could force the Carter administration to reassess its support of the reformist junta that took power in El Salvador after a coup 15 months ago. U.S. policy since then has been to prod the junta toward seeking reconciliation between the country's warring leftist and rightist factions.

However, a struggle for control within the junta appears to have been tipping toward rightist factions representing the business and land-holding classes, and they are believed to have been encouraging the Salvadoran military and security forces to engage in assassinations that could trigger another coup putting the country firmly under right-wing control.

It now is clear, the officials said, that the junta, despite its professed good intentions, is unable to control rightist sympathizers within the security forces who, as one official put it, "keep wandering off the reservation." Another official likened the junta to the German scientist in the film, "Dr. Strangelove," who couldn't prevent an arm from acting on its own, and he added: "In this case, the arm is the security forces."

As a result, the officials added, the administration now must face the tough choice of whether to continue backing the junta, despite the murder and terrorism taking place under its umbrella, or whether to abandon that support and run the risk of a takeover by the Salvadoran extreme right.

Complicating the situation is the fact that the incoming administration of President-elect Ronald Reagan contains influential conservative elements who believe President Carter's policy has been too conciliatory toward leftist forces in Central America and who advocate a tilt toward avowedly anti-communist elements within El Salvador.

Reagan's advisers are known to have marked Robert E. White, the U.S. ambassador in San Salvador and the leading advocate of cooperation with the junta, for replacement as soon as the new administration takes office. In a report prepared recently by the Reagan transition team, White was criticized for acting like "social reformers and advocates of new theories of social change with latitude to experiment within the country to which they are accredited."

State Department officials believe that much of the rising violence in El Salvador stems from the belief of rightist extremists that if they can gain undisputed control, their efforts will go unchallenged by a basically sympathetic Reagan administration. However, some officials noted yesterday, a terrorist campaign at its current murderous levels is something that even Reagan's most staunchly anti-communist advisers would be unable to support and could force the new administration to back away somewhat from its advocacy of the Salvadoran right.

At the heart of U.S. concern is fear that a right-wing takeover would have implications that would spill over El Salvador's borders and create tensions and violence throughout Central America. Specifically, the fear is that a new coup would produce open civil war that would bring communist Cuba and leftist regimes like the Sandinista government of Nicaragua into the conflict, either openly or covertly, on the side of Salvadoran leftists, while the region's military-dominated countries like Guatemala and Honduras would support the rightists.

The aid suspension announced yesterday involves $20 million in economic support funds, of which approximately $5 million in military sales credits that had been intended to allow the Salvadoran military to buy non-lethal equipment. Also being suspended is a controversial program under which 250 Salvadoran officers were being trained at U.S. army schools in Panama in techniques of dealing with guerrillas while observing human rights.