Republican senators derailed a Democratic effort to repeal the ban on gays serving openly in the military, successfully putting off a defense-funding bill and likely pushing back any further moves to end the so-called Don't Ask, Don't Tell ban until after November's congressional elections.

Democrats failed to garner the 60 votes needed to break a Republican filibuster, with 56 senators voting Tuesday in favor of proceeding with the legislation and 43 against.

Democratic senators Blanche Lincoln and Mark Pryor, both of Arkansas, voted with Republicans against proceeding. So did Senate Majority Leader Harry Reid (D., Nev.), in a procedural tactic that leaves him the option of reviving the bill at a later date.

Republicans objected to Mr. Reid placing restrictions on amendments to the bill and also said Democrats were loading the legislation with measures not central to defense. Republicans objected to Democratic plans to vote on a limited number of amendments, including a provision allowing certain children of immigrants to obtain legal status, which many Republicans oppose.

The successful filibuster is a setback for President Barack Obama, who had promised to end the 1993 ban on gays serving openly in the military.

Unlike gay marriage, allowing gays and lesbians to serve in the military has become a less divisive issue since 1993, when the current ban on allowing homosexuals to serve openly in the armed forces was put in place. A majority of the public supports ending the ban.

The issue has gathered more attention lately, in part because of efforts by pop star Lady Gaga, who Monday attended a Maine rally to push for the repeal.

But opponents of the repeal had lobbied sympathetic senators vigorously. Republican senators also opposed taking action to repeal the ban before a Pentagon review of the policy—which is currently under way—is completed.

"This is a victory for the men and women who serve our nation in uniform—at least for now they will not be used to advance a radical social agenda," said Tony Perkins, a Marine Corps veteran and president of the Family Research Council, which has led opposition to repealing the ban.

Advocacy groups that support ending the ban on gays serving openly complained that the vote had become ensnared in campaign politics.

"It was a major setback in treating all service members the same without regard to their sexual orientation," said Aubrey Sarvis, the executive director of the Servicemembers Legal Defense Network.

More broadly in Tuesday's debate, Republicans denounced Mr. Reid for not allowing more GOP amendments. Mr. Reid said the first three amendments would be a Republican move to strip out the "Don't Ask, Don't Tell" repeal; the immigration measure, called the DREAM Act; and a provision to bar secret "holds" on legislation in the Senate.

The immigration measure would grant six years of legal residency to high-school graduates who have lived in the U.S. continuously for five years and arrived by the age of 15. They would become eligible for citizenship if they attend college or serve in the military for two years during the legal residency period.

Sen. George Voinovich (R., Ohio) said Mr. Reid had turned an important measure to fund the Armed Services into a "messaging bill" with the coming election in mind.

"If the Democrats are serious about passing this bill in a timely fashion, they wouldn't be attaching amendments that are not relevant to the common defense, in addition to making it impossible for Republicans to offer their own amendments," Mr. Voinovich said.