Singapore Prime Minister Lee Kuan Yew strode into the lion's den of the U.S. Congress yesterday to deliver an impassioned attack against protectionist legislation, which he said would set off "a downward spiral in the world economy" and increase political turmoil in developing nations.

He received polite applause from legislators who have made America's soaring trade deficit a major focus of activity during the past month. House Speaker Thomas P. O'Neill Jr. immediately postponed consideration until today of a bill to lower textile imports sharply. The measure would particularly affect fast-growing Pacific rim nations such as Singapore.

"In recognition of today's address and as a courtesy to the prime minister, I didn't think it was the thing to do on the same day as this address," O'Neill said, explaining why he pulled the bill off the floor 10 minutes before the House was due to take it up. The legislation is expected to pass by an overwhelming margin, but probably will be vetoed by President Reagan.

Some proponents of the textile bill criticized the delay. "I don't have any Singapore people who vote for me. I'm not concerned about their jobs. I'm concerned about South Carolina," Rep. Butler Derrick (D-S.C.) said he told O'Neill.

The textile bill, which an aide to the speaker described as having "passionate support" in Congress, is in the vanguard of protectionist legislation. It is unclear, however, whether its sponsors can muster enough votes in both houses to override a veto.

In his speech to a sparsely attended joint session of Congress, Lee painted a bleak future for the world if the United States uses protectionism in an effort to solve its problems of factory shutdowns and surging unemployment in manufacturing industries.

His speech was the centerpiece of Lee's four-day trip to Washington, and marked the first time a head of government has devoted an entire address to a joint session of Congress to the trade issue.

Lee credited American support of free trade since the end of World War II with enabling nations along the Pacific rim to prosper and provide a counterweight to the socialist model of development prevalent in much of the Third World.

"Putting up barriers to American markets would halt the economic advancement of the free market-oriented developing countries. It would send a signal that the model provided by the countries of East and Southeast Asia is no longer an available option," Lee said in one of three statements that drew applause.

He said if the United States closes its market, China will be forced to slow its modernization to the point where "she will become restive"; Japan will be pushed into closer ties with either the Soviet Union or China, and the shift of developing countries toward democracy and free enterprise will end.

"Is America willing to write off the peaceful and constructive developments of the last 30 years that she had made possible?" asked Lee, 62, Singapore's first prime minister.

"Does America wish to abandon the contest between democracy and the free market on the one hand versus communism and the controlled economy on the other, at a time when she nearly has won this contest for the hearts and minds of the Third World?

"Let us not forget," Lee continued, "that protectionism and less trade means less growth for the developing countries. . . . Severe or repressive government is the other side of austere or negative economic growth."

He praised President Reagan's decision last month to join with France, Great Britain, Germany and Japan in coordinated intervention to bring down the value of the dollar, and urged Congress to "stay its hand and allow these efforts time to work."

But Lee said "lobbyists for the Japanese" should not assume his antiprotectionist stance means he opposes U.S. measures to end their trade restrictions.

"I do not suggest that the Japanese should not be cajoled, and if necessary coerced, with all the powers at America's command, toopen up their markets," Lee said to a burst of applause.

"It is right that she should be made to abide by the rules that have brought her to her present unprecedented prosperity," he added to further applause.

"The rest of Asia will cheer with joy, for then their goods will also get into Japan without going through an obstacle course," he continued.

"But for America to put tariffs or barriers to Japanese goods, instead of tearing down Japanese barriers to American exports, will hurt the rest of Asia twice over. First by having these same tariffs and barriers to overcome to sell to America, and second, by not being able to sell to Japan because Japan cannot sell to America."