The West German government today criticized President Reagan's decision Friday to extend sanctions against the planned Soviet natural-gas pipeline, saying the action contradicts understandings reached earlier this month among Western allies at the economic summit meeting in Versailles.

West Germany is consulting France, Britain and Italy to determine how to go ahead with the project despite U.S. opposition, Bonn's chief spokesman, Klaus Boelling, said at a press conference. He reiterated his government's opposition to economic embargoes "because we do not expect them to have any effect."

The West German firm with most to lose as a result of the U.S. sanctions, AEG Telefunken, said in a weekend statement that the extension of the ban to cover equipment produced by U.S. subsidiaries abroad or by foreign holders of U.S. licenses had ruined efforts to find a "European solution" around the restrictions.

West German Economics Minister Otto Lambsdorff attacked Reagan's action as a threat to German jobs, Reuter reported, criticizing the fact that it came only two weeks after the Versailles pledges on free trade.

The ban's extension would appear to block AEG as well as Britain's John Brown and Italy's Nuovo Pignone--all engineering contractors for the turbines to pump gas along the pipeline--from turning to a French firm, Alsthom-Atlantique, for rotor blades to substitute those that were to have been supplied by General Electric. The French firm holds a GE license for the blades and is reported to be the only European company capable of making the specialty parts.

AEG, which is already in serious financial trouble, said the expanded restrictions would have serious consequences for it and could endanger thousands of jobs at its Essen subsidiary, AEG Kanis, and among its suppliers.

Judging from private and public outcries here this weekend, Reagan's action has disturbed seriously the sense of restored harmony to U.S.-West German relations that followed the president's visit to West Germany less than two weeks ago.

Senior government and party members had been under the impression, often drawn from personal visits to Washington this spring, that the United States intended quietly to relax its opposition to the 3,700-mile-long pipeline in view of Western Europe's unwavering support for the project.

Bonn's interest in the deal is based on a wish to diversify its energy sources away from the Persian Gulf and to maintain traditional trading links with the Soviets to promote overall European stability. U.S. criticism of the project seemed in West German eyes to lack conviction because of the Reagan administration's unwillingness to halt grain shipments to the Soviet Union.

The United States had been expected here to shift its economic offensive against the Soviets from commercial goods to financial sanctions and to tolerate the building of the pipeline. This at least was what Bonn officials read between the lines of the declaration on world trade at the Versailles summit of the seven major industrialized nations.

"In this decision," Boelling said today of Reagan's action, "we see a contradiction to the agreements that were made in Versailles."

The Versailles communique issued June 6 showed the United States, West Germany, France, Britain, Italy, Japan and Canada agreeing to follow a "prudent and diversified" economic approach to the Soviet Bloc and to take into account a need for "commercial prudence" in limiting export credits to the Soviet Union and its allies.

The language was vague enough to allow each country to apply its own interpretation. Afterward, both France and West Germany indicated that they had no intention of engaging in economic warfare against the Soviets, while U.S. officials said claimed they had won a European commitment to apply economic, commercial and financial pressure to the Soviets alongside political and diplomatic measures. The Association of German Industry expressed "astonishment" at the expansion of pipeline sanctions, as industrialists and diplomats predicted privately that the move could further poison trade relations between the United States and Europe, already troubled by differences over interest-rates and steel shipments.

Senior Bonn officials also questioned whether Washington legally can regulate contracts involving U.S. subsidiaries and licensees abroad.

Several energy industry experts mentioned the possibility that the Soviet Union will now decide to forgo reliance on Western turbine technology in building the pipeline, relying instead on its own less advanced techniques.

This would result in a delay of at least seven years in completion of the line, originally scheduled for 1984, these experts said.