From the beginning, the fight over releasing $1.5 billion for 21 MX missiles was a vote some Democrats feared they could not afford to win -- and in the end, that may have tipped the balance toward President Reagan.

They were torn between their opposition to a weapon that many argued was flawed, costly and vulnerable and their concern that denying Reagan the MX just as the arms talks had resumed in Geneva would typecast the Democrats as soft on defense.

"The closer we [got] to having the votes, the more nervous some Democrats got," an aide to one of the leading Democratic opponents conceded yesterday before the vote.

But the narrowness of the president's victory -- 219 to 213 -- in a House that contains 14 more Republicans than it did a year ago signals that the administration's request for 48 more missiles in fiscal 1986 will face strong opposition in coming months.

Sixty-one Democrats voted with the president.

It took all of Reagan's lobbying muscle plus the extraordinarily high-profile role of two Democrats -- U.S. chief arms negotiator Max M. Kampelman and House Armed Services Committee Chairman Les Aspin (D-Wis.) -- to push the weapon through a reluctant House.

All day, lobbyists on both sides of the fight worked to nail down wavering Republicans and Democrats, but little changed.

Administration officials reported that the missile was a much tougher sell in the House than the Senate for a variety of reasons, despite the effectiveness of Kampelman's trip back from Geneva to argue that a vote against the MX would undermine the U.S. position in the arms talks and prolong the negotiations with the Soviets.

Democrats, on the other hand, found it impossible to switch enough votes in the final hours to give them a victory.

"What was surprising was that there were no surprises," a leadership aide said just after the vote.

Lobbyists on both sides of the fight had a short list of Republicans and Democrats who appeared to be on the fence.

When the vote came, the White House lost many of them, including at least four Republicans.

The Republicans included Paul B. Henry of Michigan, John Miller of Washington, Nancy L. Johnson of Connecticut and William F. Goodling of Pennsylvania.

Rep. William J. Hughes (D-N.J.) voted against the weapon despite a lobbying blitz that included classified briefings from the Pentagon, a visit last week with Reagan and calls from Defense Secretary Caspar W. Weinberger and Secretary of State George P. Shultz.

But anti-MX organizers had run radio ads in his district urging voters to support him in opposing the weapon. He said he decided to go against the president because he thought the MX was vulnerable to attack.

Another Democrat who ended up opposing the weapon was Rep. John McK. Spratt Jr. Jr. (D-S.C.), who called a news conference in the afternoon to say he was undecided. He had voted against the MX in the past, but what troubled him, he admitted, was the question of what Democrats would do if they succeeded in blocking it.

Even House Speaker Thomas P. (Tip) O'Neill Jr. (D-Mass.) had wrestled with that issue.

Although he opposed the weapon, O'Neill was influenced by post-election polls that showed the Democrats were seen as weak on defense.

That feeling did not prevent House Democratic leaders from mounting a united front in opposition to the weapon, but it permeated the atmosphere among Democrats.

Even some who voted against the missile yesterday reportedly told administration officials they hoped the MX funds would be approved.

The ambivalence is likely to show up more strongly later this year when the House considers Reagan's request for an additional 48 missiles.

Aspin has signaled his intention to cut back on the request, as have other leading MX supporters in both House and Senate.

But in voting yesterday, many House Democrats were looking backward at November and their party's tattered image, and not forward to the budgetary debate that may provide them the political cover they are seeking to vote against the missile.

Politically, not enough Democrats were willing to call Reagan's bluff on the impact an MX defeat would have on the arms talks, nor were they ready to answer to the public if Reagan accused them of causing the talks to collapse.