The outbreak of war between Iraq and Iran demonstrates once again that good-guyism does not work in foreign affairs. To prove its sterling character to Ayatollah Khomeini, the United States proclaimed a strictly neutral attitude.

It thus rendered itself impotent in the vortex of world politics. Now whatever happens works against American interests and leaves Russia as the dominant power in the area.

The American position surfaced in a quick diplomatic excange. As soon as the fighting with Iraq began to mount, Ayatollah Khomeini fingered the United States. "We are at war with America," he said, "and today the American hand is showing throught the sleeve of Iraq."

President Carter, in Los Angeles, announced that the United States was "not taking a position," and then let slip the reason why. He said the conflict might convince the Iranians they needed friends, "and therefore induce them to release the hostages." Privately, American diplomats explained that if the hostages were released, the United States would make spare parts available to Iran and work through the Islamic bloc at the United Nations to promote a cease-fire.

Putting the United States at the mercy of the ayatollah yielded the usual non-results with respect to release of the hostages. Meanwhile, events unfolded in a way predictably at odds with American interests. First of all, the fighting intensified. While the military action has not been decisive, it has raised a direct threat to the flow of oil from both countries. Once again there is the possiblity of a supply crunch.

Second, a dark shadown was cast across the monarchical regimes of Kuwait and Saudi Arabia and the shiekdoms of the lower Persian Gulf. For those countries -- which supply the great bulk of foreign oil consumed in Europe, Japan and the United States -- are highly vulnerable to the political acids distilled in Tehran and Baghdad.

If the Iraquis emerge as top dog in the fighting, the left-wing socialists of the Baath regime there will be in still better position to subvert the dynasties of the Gulf. If the Iranians do well, the religious fundamentalism of the ayatollah will inspire new hostility to the "imperialism" of the oil sheiks.

An adverse impact on the Camp David process is equally assured. Serious hopes for further progress depend on bringing Jordan into the talks between Egypt and Israel. The jordanians, however, will not come forth unless given at least tacit support by Saudi Arabia.

But the Saudis find themselves living with still more evidence of American weakness. They will have to gauge even more sensitively the relative influence of Iran and Iraq. Whichever way the Saudis turn, they will be advancing toward hard-liners of the Arab-Israel question.

The one thing President Saddam Hussein of Iraq shares with the ayatollah is an attitude of the deepest intransigence toward what he calls the "Zionist entity." So whoever gains the edge in the fighting, the Saudis will be even more pushed to align themselves against settlement with Israel.

Last, there are the Soviets. Saddam Hussein, while cracking down hard on the communists within Iraq, personnaly engineered a security treaty with the Russians a decade ago, and now depends on Moscow for sophisticated weapons. He sent one of his closest collaborators, Tariq Aziz, to Moscow after the fighting with Iran turned serious. Clearly the Russians will solidify their position in Baghdad by not pulling the string on the Iraqi military effort.

At some point, however, opportunity will also beckon to the Russians in Iran. Either they can patronize a settlement that saves the regime of the ayatollah, or -- if the regime cracks -- they can pick up the pieces. In either case Russia has become the arbiter of conflict in the Persian Gulf.

Apologists for President Carter will no doubt claim that the United States had no alterntive. They will, in that connection, mouth the usual pop sociology about the "inexorable workings of a revolution brought on by the shah."

But they have a lot to explain. Why, when the shah was forced out, did the president pretend that nothing much happened? How come the Carter Doctrin, proclaimed with such Fanfare only eight months ago, turned out to have no application? Above all, why is the United States so paralyzed now? Why doesn't it move to promote a pro-Western government in Tehran? Wouldn't that satisfy the Iraqis, reasure the Saudis and bring the war to an end? wouldn't that enable the United States to emerge as top dog in the area?

The answer to all these questions is the same. The Carter administration has no concept of the strategic importance of Iran. It felt guilty about the American presence in that country. And the process of trying to purify itself, it became the author of America's self-defeat in the Gulf.