WEST GERMANY is exasperated with the United States these days, charging it with posturing of a decidedly risky sort. The United States is equally exasperated with West Germany. The American indictment charges the Germans with a self-centered complaisance in the face of repeated Soviet trespasses. This kind of exchange is a reminder that alliances do not hold together merely because they serve the most profound national interests of the allies. Sometimes alliances are eroded by sheer bad temper.

Why so scratchy a tone? The explanations begin with things that have little to do with foreign policy. Economic plans are going badly in both countries, souring the moods of people in power. The dilemma is essentially the same in both countries. In both, governments a decade ago made sweeping promises of expanded social benefits, counting on future economic growth to pay for them. When the growth failed to appear, voters demanded that the politicians do something about it. Neither Bonn nor Washington has found a magic that works, and both are struggling with large public deficits, inflation and unemployment that is not only high but rising.

In Germany, the unemployment rate is exacerbating the strains in Chancellor Helmut Schmidt's Social Democratic Party and his troubles with its left wing. He has replied with a job creation program that requires a tax increase and, to get it through the Bundestag, he had to force a vote of confidence. That's a great rarity in German politics, and not a sign of strength. Now, on top of their other troubles, the Germans are confronted with rumors of scandal involving campaign financing and several senior officials. It's been a long, wearing winter in Bonn.

The specific stages of the German-American dispute over the past half-year have all concerned the Soviet Union. First there was the row over nuclear weapons last fall, and the peace demonstrations. Then there was the imposition of martial law in Poland, when the Germans incensed the Americans by shrugging and saying that it was inevitable. Positions on both sides were sharpened by a deep sense of frustration at being unable to do anything that would actually make much practical difference in Poland. Now there is the European participation in the Soviet gas pipeline. The American campaign against it is beginning to take on the shrill tone of an ideological vendetta.

Sen. Ted Stevens, Republican of Alaska, proposes that, if the Europeans continue with the pipeline, the United States ought to punish them by withdrawing its troops from Europe. At this point, the quarrel is getting angrier and more reckless than the actual differences of policy can begin to justify. It would be worse than ironic if the Polish events ultimately turned out to have done more damage to the Atlantic alliance in the West than to the Russian hegemony in the East.