The anti-abortion movement suffered an emphatic setback yesterday as the Senate decisively rejected a proposed constitutional amendment to permit legislatures to ban the procedure.

The vote was 50 to 49 against the amendment, as abortion foes fell 18 votes short of the two-thirds needed for passage.

"Frankly, the size of the vote was beyond my fondest hopes and expectations," said Sen. Bob Packwood (R-Ore.), who led the fight against the amendment and predicted that the congressional abortion battle is now over, except possibly for continuing struggles over federal funding of the procedure.

And Sen. Orrin G. Hatch (R-Utah), principal sponsor of the amendment, said, "Frankly, I'm going on to other issues." The vote represented one of the most serious setbacks so far for the New Right, which gained a major foothold in the Senate in the 1980 elections and embarked on an agenda of social issues that included abortion, busing and school prayer.

It also represented a defeat for President Reagan, who opposes abortion and was lobbying among senators on behalf of the amendment, according to Hatch.

It was the first time in the 10 years since the Supreme Court upheld the right to abortion that an amendment to overturn the decision has reached the floor of either chamber, although both the Senate and House have voted dozens of times on proposals to restrict federal abortion funding.

Hatch contended that the anti-abortion cause was not actually defeated but caught in a 50-50 draw because Sen. Jesse Helms (R-N.C.), who intends to pursue his legislative proposal to end abortions, voted present on the amendment. Helms said he could not support the amendment because it would allow continued abortions in states that do not ban them.

But Hatch acknowledged he was disappointed by the outcome.

When the abortion debate opened Monday, both sides indicated they thought the amendment would get a majority but would fall short of the 67 votes that would be needed if all 100 senators voted.

The proposed amendment, stating that "A right to abortion is not secured by this Constitution," would have allowed both Congress and state legislatures to restrict or ban abortions, which they cannot do now under the court's ruling.

In two days of sometimes impassioned but mostly low-key debate, Hatch accused the Supreme Court of sanctioning "abortion on demand" that has led to nearly 2 million abortions a year, only 3 percent of which, he said, were to save the life of the mother.

"Even dogs have protection in this society," Hatch said. "They have more protection than the 2 million unborn children that are destroyed every year."

The country, added Sen. Jeremiah Denton (R-Ala.), is on "the slippery slope toward infanticide."

Summing up his case, Packwood warned colleagues that the issue would continue to haunt them in every campaign and every legislative session if the amendment were approved. "That is not a plague that should be visited on this country," he said, adding that it would "divide this country for a generation."

Sen. Edward M. Kennedy (D-Mass.) took aim at conservatives who back abortion restrictions while advocating less government involvement in other activities.

"They talk of taking government off people's backs," Kennedy said, "and then fight to put government into people's bedrooms." Criticizing conservatives' votes against health care, immunization and employment programs, he said, "In the name of less government, they turn their back on proven alternatives to abortion and then seek to resolve the problem by the most intrusive kind of government of all."

In comments after the vote, pro-choice advocates hailed it as a major defeat for the anti-abortion cause, while anti-abortion groups said that even getting the amendment to the Senate floor for a recorded vote was a major achievement and vowed to continue fighting for an end to abortions.