The House voted, 220 to 207, last night to go ahead with production of the controversial MX nuclear missile after an all-out round of lobbying by President Reagan and top administration officials.

The decision came on a motion to strike $2.5 billion in procurement funds for the controversial, 10-warhead missile that is to be installed in existing Minuteman silos.

It was a victory for the president but was greatly tempered by the fact that it was 40 votes short of his 239-to-186 victory margin in May when the House approved MX flight testing and basing studies.

The debate was also marked by a blunt speech from House Majority Leader James C. Wright Jr. (D-Tex.), who declared his independence from Reagan on the MX issue in terms that could spell long-lasting trouble for the White House on various issues.

Wright, who had voted with the president in May, said he is tired of compromising with a man who thinks compromise is "a one-way street" in his direction.

Other MX opponents, in effect, announced, "Wait until next time," perhaps September, when the issue will come up again on the defense appropriations bill. Last night's action was on an amendment to a $187.8 billion defense authorization bill.

Among those voting last night to cut funding was House Appropriations Committee Chairman Jamie L. Whitten (D-Miss.), whose panel will be first to consider the appropriations bill this fall.

"The Reagan administration went crazy on this vote," said Thomas J. Downey (D-N.Y.), a leader of the anti-MX forces. "If this is the effort they had to expend for a 13-vote margin, I can't imagine they can gin it up" again.

Wright, under pressure from junior Democrats upset with his pro-MX vote in May, lent strong support to that notion.

"For me, at least, the time has come to say 'Enough!' " he declared in a floor speech denouncing what he described as the administration's "painfully misguided priorities."

He noted that annual military spending has increased by more than $100 billion since 1980 while Reagan's "tax cut for the wealthy," as Wright described it, "is draining $135 billion from the government's revenue" this year alone.

In May, Wright and other influential House Democrats such as Democratic Caucus Chairman Gillis W. Long (D-La.) voted to release $625 million for MX flight testing and basing studies because they thought they had a satisfactory pledge from Reagan to respond with a show of flexibility on arms control. Lining up with Reagan then were 91 Democrats, while only 73 did so last night.

"By September," Edward J. Markey (D-Mass.) predicted, "we will have the votes to kill the MX."

The vote in May was seen as a clear endorsement of the recommendations of a presidential commission headed by retired Lt. Gen. Brent Scowcroft to deploy the MX, start planning for small, mobile missile that might replace it and show more flexiblity in arms control talks with the Soviet Union at Geneva.

Reagan, Vice President Bush and other top administration officials lobbied hard during the last week to move ahead with MX deployment, but several leading Democrats appeared to be flinching in the face of accusations from indignant colleagues that they had been hornswoggled in May.

The showdown came on an amendment co-sponsored by Charles E. Bennett (D-Fla.) and Nicholas Mavroules (D-Mass.), both members of the House Armed Services Committee. It would have preserved another $1.98 billion in research and development funds for the missile while denying procurement money.

The president sought to counter the Democratic shift with telephone calls to wavering legislators and a three-page letter to Armed Services Committee Chairman Melvin Price (D-Ill.). In it, Reagan warned that elimination of all MX production funds would "send the wrong signal to the Soviet Union" and could "pull the rug out from under our negotiators in Geneva."

Reagan credited support for the Scowcroft commission's recommendations for the fact that "the Soviets are beginning to make some changes in their negotiating position . . . . " He said, "We need the MX, not only for force modernization, but to keep the Soviets moving at the negotiation tables."

MX critics charged, however, that recent statements, such as one by Arms Control and Disarmament Agency Director Kenneth L. Adelman, showed that the administration is "not serious" about changing its approach to arms control.

Mavroules said Assistant Secretary of Defense Richard N. Perle answered affirmatively when asked by a House arms control panel last week whether "we would proceed with MX" regardless of progress at Geneva. In other words, Mavroules said, "MX is no bargaining chip."

Even with a $2.5 billion slash in procurement funds, Mavroules added, "The United States would still be spending $491 million a week for strategic weapons in fiscal 1984." The B1 bomber, the Trident submarine and other programs in the defense bill, he argued, make it clear that "with or without MX, the United States is not a weak or threatened nation."

Les Aspin (D-Wis.), whose outspoken support for the MX in May as part of the "Scowcroft package" rankled many liberals, continued to speak out for it last night, drawing applause primarily from Republicans. He urged the House to end 10 years of vacillation and decide to build a new missile instead of constantly voting only for research and development money.

"How do we get the Soviet Union to negotiate seriously about their ICBMs if we can't decide on ours?" Aspin asked. "We don't go anywhere on this issue. We're still where we were 10 years ago."

Robert E. Badham (R-Calif.) agreed, saying, "We have embraced a 'don't-ever-build-it, don't-ever-produce-it philosophy.' "

Other critics such as Ronald V. Dellums (D-Calif.) denounced the commission-style "politics of packaging" surrounding the MX and complained about how vulnerable it will be in Minuteman silos.

House Minority Leader Robert H. Michel (R-Ill.) said the whole debate reminded him of the old song, "It Seems We Stood and Talked Like This Before." He said that the MX might not be perfect but that "it's the best workable answer" to the problem of modernizing U.S. strategic forces.

"Without production funds," Michel contended, "R&D won't mean research and development, it'll mean retreat and delay."

Wright, elaborating on his decision, told reporters he concluded that he had done enough at Reagan's behest.

"As far as the president is concerned," Wright protested, "bipartisanship is one-way street . . . . You've got to give him every penny he wants. It's just not fair. The whole damn, dratted thing has just brought out a total imbalance--spending more and more for the military, giving more and more to the wealthiest few."

Wright said it has taken him a long time and several frustrating sessions with Reagan over 2 1/2 years to reach this divide.

One such meeting, he said, took place at the White House early last year. The subject was the Reagan budget, and Wright said he tried to make the point that with the projected tax cuts and devastating deficits ahead, "Mr. President . . . we've got to cut military spending."

Reagan's reply?

"He said, 'Oh, Cap Weinberger has already squeezed all the waste out of that,' " Wright recalled in incredulous tones.

Wright said he will not stop compromising with the White House when it seems appropriate, but that he was going to say "no" more often. He said he told the president as much "in a polite way" at a White House meeting about the MX last Friday.

Wright's stance could have important ramifications for many other administration proposals and for his long-range prospects of becoming House speaker.

"I helped on the Caribbean Basin Initiative . . . I helped on El Salvador," Wright said. "I just have not found any reciprocity, any willingness to think about people . . . . I don't think he's a wicked man. I just think he's an ideologue who believes in a Calvin Coolidge-type philosophy."