President Reagan vowed yesterday to fight for the controversial MX nuclear missile despite warnings by Sen. Barry Goldwater (R-Ariz.), prospective chairman of the Senate Armed Services Committee, that neither house of Congress will support continued production of the weapon.

Administration sources said Reagan, in a private 30-minute meeting with Goldwater yesterday, urged the senator to "keep an open mind" on the MX and insisted that the missile is a vital bargaining chip in arms control negotiations scheduled to resume next month with the Soviet Union.

"If we're going to get any concessions from the Russians, we've got to bargain from a position of strength, and the MX is essential to getting them to take our proposals seriously," an official said Reagan told Goldwater.

The Arizona senator, due to assume the Armed Forces Committee chairmanship in January, wrote Reagan Dec. 3, saying, "We do not have the votes, let me repeat that, we do NOT have the votes in the Senate or the House to pass the MX in the coming vote . . . . "

Goldwater urged Reagan to limit his support to urging that about $1.5 billion be spent to produce 21 previously authorized MX missiles when the issue comes before Congress in late March or early April. He asked the president to "lay off any formal request" for more money, apparently a reference to the $3.7 billion for 48 MX missiles sought by the Defense Department in the fiscal 1986 budget.

Goldwater went further in a Washington Post interview two days after he sent the letter to Reagan. He called for abandonment of the MX, saying of upcoming votes on the missile: "I don't think he Reagan can win it, so why get your ass knocked off?"

But Reagan showed no inclination to heed this warning in yesterday's frank talk with Goldwater, which one source called "an earnest meeting" in which neither man's opinion was changed.

Officials said Goldwater argued that Reagan should not "expend political capital" in a fight he cannot win. Reagan stuck to his ground that the MX was important to the arms talks.

"The president's going to fight for more MX missiles," White House deputy press secretary Robert Sims said. "He knows we have an uphill battle on our hands and will be involved personally. The program is essential to our security, to negotations with the Soviet Union and to credibility among our allies."

Reagan also made known his MX views in a letter to Defense Secretary Caspar W. Weinberger that revealed concern that Air Force officials might join Goldwater in abandoning the missile. Reagan called the MX "a vital element of our strategic modernization effort" and instructed "the senior leadership of the Department of Defense and particularly the Air Force" to lend its "enthusiastic support" to a campaign for congressional approval.

The Air Force responded yesterday when the chief of staff, Gen. Charles Gabriel, visited Goldwater Reagan "knows we have an uphill battle on our hands." -- Deputy press secretary Robert Sims with a message virtually identical to the one expressed by Reagan in his letter to Weinberger.

"If we fail, our chances of achieving meaningful arms reductions will be substantially diminished and our nation's security will be weakened . . . ," Reagan wrote.

The administration seeks to deploy 100 MX missiles, each armed with 10 nuclear-tipped warheads and carrying the explosive power of 300,000 tons of TNT. Twenty-one of the missiles are in production and scheduled for deployment in 1986, and another 21 are awaiting the outcome of the spring vote in Congress. Of the remaining 58, 48 are proposed by the Defense Department in the fiscal 1986 budget.