The House yesterday dealt President Reagan his first major defeat on defense policy by voting 245 to 176 to drop production money for the MX missile from this year's Pentagon budget.

Fifty Republicans joined 195 Democrats in opposing the president on the vote, which both sides regarded as the first important test of sentiment on Reagan's defense buildup and nuclear weapons strategy since the Nov. 2 midterm congressional elections. Only 38 Democrats supported Reagan, along with 138 Republicans.

In a statement issued by the White House last night, the president called the vote "a grave mistake," which, unless reversed, "will seriously set back our efforts to protect the nation's security and could handcuff our negotiators at the arms table."

"I had hoped that most of the members in the House had awakened to the threat facing the United States," Reagan said. "That hope was apparently unfounded. A majority chose to go sleepwalking into the future."

But Rep. Joseph P. Addabbo (D-N.Y.), sponsor of the winning amendment to remove the intercontinental nuclear weapon from this year's defense appropriations bill, suggested the vote might be a harbinger of a more fundamental turnaround on defense spending, which Reagan has greatly increased while cutting both taxes and domestic spending.

"The message is that the people on Nov. 2 spoke loud and clear that defense systems are not sacrosanct," said Addabbo, who is chairman of the House Appropriations subcommittee on defense.

The House is expected to finish work on the defense appropriations bill today and send it to the Senate.

MX critics there, led by Sen. Ernest F. Hollings (D-S.C.), say they also have enough votes to remove production money for the missile from the bill.

The House members' vote on the MX, which Reagan has pushed to modernize the land-based part of the so-called triad of land, sea and airborne weapons, was the first repudiation of any president on a major strategic weapons system since Congress shot down the anti-ballistic missile system 13 years ago.

The House vote, however, which deleted $988 million in production funds, does not kill the missile program.

The bill still contains $1.7 billion in research and development for the MX and an additional $715 million in research and development funds for its basing system.

MX opponents focused their attack not so much on the missile itself as on the administration's proposed "Dense Pack" basing plan to bunch 100 missiles in hardened silos in a small area near Cheyenne, Wyo., in hopes that if the Soviets attacked, most of their incoming missiles would be destroyed when the first ones exploded.

Administration spokesmen contended that the missile, despite any technical problems with Dense Pack, was needed to strengthen the president's hand in bargaining with the Soviets for arms control reductions. Addabbo told the House:

"I do not think it's a bargaining chip if you build a missile for billions of dollars and you have no place to put it except in a warehouse."

Jack Edwards (R-Ala.), who led the debate in favor of the MX, said "The MX became symbolic as the place to cut."

The rejection reflected skepticism about the basing mode, he said, adding, "It may be that ultimately, we'll have to find a different approach . . . . The MX is going back to the drawing board . . . . Dense Pack is not flying."

Reagan's proposed $1.6 trillion five-year military buildup has been under increasing pressure from Republicans as well as Democrats in recent months, and particularly since the election.

The Republicans who voted with Addabbo yesterday were, by and large, moderates from the Northeast and the Midwest. Six of seven New Jersey GOP members, all three Iowa Republicans, both Connecticut Republicans and five each from Pennsylvania and Illinois voted to deny the production funds.

The GOP defections were important; in most crucial budget and defense votes of Reagan's term, the Republicans have lined up behind the president.

A number of southern Democrats who normally vote with the Pentagon also defected this time.

"A non-credible leg of the defense triad is no bargaining chip," said Florida Democrat Charles E. Bennett, normally a strong advocate of military spending. "There's too much money at stake in this matter to use it on this incredible type of plan."

Carroll Hubbard Jr. (D-Ky), told the House, "I say to the Pentagon on this issue, the words, 'Here come the Russians' don't scare people as much as 'Here come the creditors.' "

However, the entire Virginia delegation voted against the Addabbo amendment, as did Maryland Republican Marjorie S. Holt. Maryland Democrats voted for cutting the MX funds.

The MX was included in the House bill after the Appropriations Committee failed to cut the funds, 26 to 26.

The administration had mounted a major lobbying effort, with personal calls from the president, who was then traveling in South America, to members of the committee.

Monday, Reagan invited 76 House members to the White House for further persuasion, but only about 45 showed up.

The president argued that MX would be a deterrent to nuclear war, and contended that the Japanese had attacked Pearl Harbor partly because the United States did not have an effective deterrent.

By yesterday evening, however, it became clear that the White House did not have the votes, and the president did not make the effort on the telephone that he did on the committee vote, because he did not want to risk his personal prestige, according to House Republican sources.

John P. Murtha (D-Pa.), who supported the missile, said that many pro-military members decided the vote was an easy political decision because it would not actually delay production of the missile.

This is because the land to bury them has yet to be purchased and an environmental impact statement must be done, which could take as long as six months.

The House rejected on a voice vote an amendment sponsored by Bruce F. Vento (D-Minn.) to delete $284.2 million for the F/A18 aircraft which, he said, "has failed crucial tests and has experienced exorbitant cost growth."

Samuel S. Stratton (D-N.Y.), however, defended the F18 as "a switch-hitter," a plane which could serve various functions and is preferable to alternatives.

The House today will take up other controversial amendments to the bill, including an effort to knock out the MX research and development funds, which is not expected to succeed.

The bill before the House includes $231 billion for military personnel, research and development, procurement, operation and maintenance and other items.

It represents a $25 billion spending increase over this year, but reduces the president's request by $18 billion.

The committee bill did, however, eliminate $498 million requested by the president to build the controversial medium-range Pershing missile, scheduled to be deployed in West Germany next year.

The missile has repeatedly failed tests and even its supporters say more research must be done before it goes into production.