In a significant shift from the usual Washington-baiting tactics, President Ferdinand E. Marcos has begun to temper his criticism of the United States and to speak of the need for a Philippine U.S. alliance.

According to Western diplomats here, Marcos has stepped back from his position of professed neutrality in recent weeks largely because of a concern over Soviet influence in Southeast Asia during the war between China and Vietnam.

In a recent speech to political supporters, Marcos said the Philippines could not remain neutral in world affairs but should ally itself with the United States.

Marcos acknowledge that he considers the United States to be "sometimes cranky" but said he saw no alternative to forming an alliance. "As for those who say that if we become neutral nothing will happen to us, they are dreaming," the president said.

In another step early this week, Marcos ordered a halt to a labor strike that threatened to cripple operations at the two principal U.S. military installations, Clark Air Base and Subic Naval Base.

Both his speech and the strike intervention represented a shift from the anti-U.S. attitude the Philippine leader began to adopt three years ago. Marcos has sought to establish friendly relations with the Soviet Union and to enlist Soviet assistance in Philippine development. His speeches were sprinkled with charges of U.S. domination and with strong declarations of a neutral course.

Western diplomats here believe Marcos' new tack reflects the concern that he and leaders of other noncommunist Southeast Asian nations now feel about recent Soviet intervention in the area.

During the war between Vietnam and China, the Soviets declared their support for their ally, Vietnam, and substantially increase their naval presence in the area as a gesture of assistance.

Marcos and his military planners are said to be particularly worried about the influence this Soviet naval presence may have in the Spratley Islands, which lie between the Philippines and Vietnam. Their ownership is contested by several countries and the Philippines now has troops on seven while Vietnam occupies three. Reports of vast oil deposits beneath the Spratleys have recently made the question of their ownership more important.

In his speech to political allies, Maros said that in case of war with Vietnam the Philippines would have to "surrender." In part, his speech was a reply to nationalist opposition leaders who have claimed that the continuation of U.S. bases in the Philippines is a danger to the country. Two years ago, Marcos himself raised the specter of his country becoming involved in an American war because of the bases.

But last week, Marcos defended his recent renewal of the base agreements here.

"The Philippines is in a most strategic place," he said."With or without the American military bases, we will always be under threat from a prospective enemy."

Marcos' intervention in the labor strike at the bases was viewed by U.S. officials as a welcome sign of support. Had it not been for the president's new, more friendly attitude, said one diplomat, "the strike at the bases would have been a perfect time for (the government) to drop the other shoe on us."

Marcos has ruled under martial law since 1972 and under his decrees strikes are technically illegal, although it has never been clear whether that included strikes at the military bases.

Some 20,000 Filipino workers at the two big bases and two minor ones walked out last Sunday and posted pickets. According to military spokesmen, the strike curtailed repairs on 14 ships of the 1mth Fleet currently visiting the yards at Subic Bay. It amounted to the largest strike in Philippine history.

Marcos earlier had indicated he would not intervene to help the Americans in the event of strikes at the bases.In his speech last week, he remained his followers that he had once warned the United States he would "let the unions do what they want and you won't have my help." That warning had been issued before the renewed warfare in Indochina and before the settlement of a new bases agreement, which brought a U.S. promise of $500 million in military aid over five years.

According to sources here, the U.S. Embassy promptly sought government help in ending the strike. On Monday, the day after it started, Marcos reportedly called in union leader Ruben de Ocampo and told him to end the strike. Marcos' labor minister, Blas Ople, personally went to the bases and read pickets a statement directing them to return to work.

Special correspondent Bernard Wideman also contributed to this story.