WASHINGTON -- The bill repealing the ban on gays serving openly in the military could present the Obama administration with a problem: It also contains money for projects the Pentagon considers wasteful.

The White House has threatened to veto any bill that contains money for weapons programs that Defense Secretary Robert Gates is trying to eliminate as part of his campaign to tame the Pentagon budget.

As a result, President Barack Obama could end up vetoing Congress' repeal of the ban on gays in the military, a legal change he promised to push through during his campaign for the White House.

Late Thursday night, the House passed an amendment to the defense authorization bill repealing the 1993 "don't ask, don't tell" law. But it also passed an amendment providing $500 million to continue developing a second engine for the F-35 Joint Strike Fighter. The House approved the entire bill, including both amendments, Friday in a vote of 229-186.

"Gates has made clear that killing the alternative engine is a top priority," said Todd Harrison, a senior fellow at the Center for Strategic and Budgetary Assessments. "He is putting his foot down."

The White House warned again Friday that the president's advisers would push for a veto if the money for the second engine remained in the bill. "It sets up an interesting predicament for the president," Harrison said.

Military leaders did not want Congress to push through the repeal in this year's defense authorization act. Members of the Joint Chiefs of Staff asked lawmakers to wait until after a Pentagon review assessing the impact of changing the law is completed in December.

But in a message to troops released Friday, Gates tried to reassure military personnel about the compromise legislation, and assure them the review still mattered.

"The legislation involved is a deferred repeal," he said. "It would repeal 'don't ask, don't tell,' but only after -- I repeat after -- the ongoing Department of Defense high-level review is completed."

Gates also emphasized that the policy will only change after the president, the chairman of the Joint Chiefs of Staff and he certified that allowing gays to serve openly will not hurt "unit cohesion, military readiness, military effectiveness and recruiting and retention."

Members of Congress who support the second engine seem to be counting on the fact that the White House will be loathe to veto a law allowing gays to serve in the military.