The 17-year battle to allow openly gay and lesbian people to serve in the US military was, for a few days this week, an accepted relic like the battles to desegregate schools or give women the vote.

The president had promised it, the courts had ruled for it, and the Pentagon’s top lawyer accepted it. The proof came when an openly gay man previously discharged under the ‘Don’t Ask Don’t Tell’ policy walked into the Times Square recruiting office yesterday without being turned away.

But a few hours ago, the Obama administration was successful in having the gay ban reinstated.

Rarely has a politician so ably demonstrated why voters distrust them. Barack Obama also extended the Patriot Act, kept Guantanamo running, and increased troops in Afghanistan, despite promising to do the opposite in each case.

A few feathers were ruffled in Democratic Party circles when the Department of Justice defended the DADT law when it was first brought to a federal district court by the gay Log Cabin Republicans group. Obama himself defended the action at his MTV appearance saying his hands were tied.

When federal judge Virginia Phillips ordered an immediate halt to all discharges, eight days ago, the military at first continued to reject new applications from openly gay and lesbian candidates. However, without influence from the White House, the Pentagon’s general counsel Jeh Johnson wrote to recruiters allowing such applications for the time being.

Meanwhile, Phillips denied a DoJ request for an immediate stay on her ruling, so they went to the US 9th Circuit Court of Appeal for an administrative stay pending the filing of an appeal. That request was successful, reinstating the gay ban at the Obama administration’s request.

All this week reporters hammered White House spokesman Robert Gibbs to explain how the administration could support the law’s repeal, but fight a court’s decision to overturn it.

“The courts in a number of different instances out west have determined that the lifespan of this policy is coming to its natural end,” Gibbs told the press gallery and reiterated President Obama’s belief that the law will be repealed by Congress in a lame-duck session after the November election.

Gibbs has also refused to answer whether the president, a former constitutional scholar, agrees with the court’s argument that gay discrimination is unconstitutional.

The White House has treated the court case as an obstacle to the repeal strategy it had devised with Defense Secretary Robert Gates and Joint Chiefs Chairman Admiral Mike Mullen. Under that strategy, the military was told its views would be heard through a 400,000-strong survey and both the Defense Secretary and the Chairman of the Joint Chiefs of Staff would have to agree that unit cohesion was not impaired before the repeal could commence.

Clinton famously underestimated the resistance the Pentagon threw up to the idea of allowing gay and lesbian servicemembers in 1993, leading to the DADT policy as a compromise. Obama’s compromise was to be close military consultation, but less than a quarter of the surveys were completed. The final report from the Pentagon working group is due on December 1.

Senator John McCain has reiterated this week he would filibuster any attempts to repeal the ban. If Republicans take back the Senate on November 2, McCain will become chairman of the Senate’s armed services committee, effectively ending any chance of repeal through congress.

Gay groups have reacted angrily to the increasing strong pushback from the White House on the issue. Even Democratic candidates have pushed back against the White House, including NY Senator Kirsten Gillibrand, tweeting she was very disappointed at the administration’s appeal.

Army veteran and Servicemembers Legal Defense Network executive director Aubrey Sarvis said the gay ban and the appeals served no useful purpose: “This interim temporary stay means that ‘Don’t Ask, Don’t Tell’ is once again on the books, and is likely to be enforced by the Defense Department. Gay and lesbian service members deserve better treatment than they are getting with this ruling.”

Meanwhile, the pro-gay Palm Centre put up a website mocking the claim by Secretary Gates that repealing the ban quickly would have “enormous consequences for our troops”, highlighting that no negative impact was seen over the eight days since the injunction against DADT was first issued.