Giving with one hand and taking away with the other, Congress yesterday approved a record $232 billion in defense spending for fiscal 1983, while telling President Reagan he can't start production on the MX missile.

Despite a significant defeat for Reagan on the controversial land-based nuclear missile he had called crucial to his defense buildup, Congress nonetheless gave the military a hefty increase of 6 percent over inflation while cutting back on jobs programs and social welfare spending, as Reagan wanted.

The defense measure was wrapped into an omnibus stopgap appropriations bill, called a continuing resolution, which passed both houses and was sent to the White House last night.

Reagan had originally requested $249 billion, but that was before the November elections, in which Democrats picked up 26 House seats and Republican senators found themselves sharply challenged as public opinion cooled toward military spending increases.

"The MX became a symbol of defense spending," said Rep. Jack Edwards (R-Ala.), ranking minority member on the House defense appropriations subcommittee. Edwards said he called the White House yesterday and "told them that if they wanted to see the roof come off the Capitol, they could veto this bill."

The measure approved yesterday kills $988 million in production funds to start building the first five MX missiles. It left $2.5 billion in the budget for research and development, but said $560 million of that could not be spent until Congress approves a basing plan for the MX.

Controversy over the administration's Dense Pack deployment plan is partly what brought down the missile in Congress. Reagan proposed that the first 100 missiles be bunched together in a small area near Cheyenne, Wyo., on the theory that attacking Soviet missiles would be destroyed by their own blast.

That plan was ridiculed in Congress as unworkable. If the president again recommends Dense Pack to Congress next spring, Edwards said, "he'd better come back with a lot of briefers or he'll suffer another defeat, I'm afraid."

The battle is guaranteed to be refought in the spring, since the measure approved yesterday calls on the president to submit a basing plan recommendation no earlier than March 1. Congress would then be committed to voting to approve or disapprove the plan within 45 days.

While the bill cuts out procurement funds for the missile, a face-saving provision attached by Sen. Ted Stevens (R-Alaska), chairman of the Senate defense appropriations subcommittee, provides that, after Congress approves a basing method, test missiles built for research and development could be deployed in some circumstances.

Stevens said such a strategy worked under the defense satellite program when, once it was discovered the satellites worked, a test satellite was used as the permanent installation.

Air Force sources, however, said such a plan would be completely impractical in the case of the MX, because test missiles, which carry no warheads, are built for specific and complex testing purposes. Even if it proved technically feasible, Edwards said Congress would never approve deployment of test missiles until a procurement plan is already under way.

Congress yesterday also attached to the bill a provision sponsored by Sen. Gary Hart (D-Colo.) to prohibit flight testing of MX missiles, because the unratified strategic arms limitation treaty, negotiated by President Carter, permits only one land-based missile and, should the MX be flight tested and then shelved, it might still count as the U.S. missile under SALT II.

Other military-related provisions of the continuing resolution included:

* A ceiling of 315,700 on U.S. troop levels in Europe. The president had planned to deploy 320,000 this year and still could if he declares to Congress that "overriding national security requirements make such action necessary." A Senate committee had originally cut the authorized level by 18,900, which the administration feared would anger the NATO allies.

* Deletion of $498 million in procurement funds requested by the president for the Pershing II missile, scheduled to be deployed in West Germany at the end of next year. The Pershing has failed several tests and congressional leaders said the money could be restored in a supplemental spending bill once its technical problems are ironed out.

* A cut of $328 million for procurement of A10 aircraft, a plane championed by the House defense appropriations subcommittee chairman, Rep. Joseph P. Addabbo (D-N.Y.), in whose constituency it is produced. Sen. John G. Tower (R-Tex.), chairman of the Senate Armed Services Committee, called the A10 "a splendid example" of Congress trying to "protect a little pork." The bill, however, leaves $29 million in the program.

In a statement on the floor, Tower said deletion of the MX production money will have "serious adverse consequences for national security." Sen. Jeremiah Denton (R-Ala.) said those who would like to replace the MX with the smaller, more mobile submarine-launched Trident D5 should realize the D5 "is just a dream, a design which cannot be deployed until 1989."

Sen. Steve Symms (R-Idaho) said, "We are really playing with the security of this country" by hampering arms control negotiations. Administration officials have argued that production should begin on the MX and the Pershing so they can be used as bargaining chips in U.S.-Soviet arms reduction negotiations in Geneva, even if they are never deployed.