A judge previously awarded the council a temporary injunction in August, but this was later overturned at the Court of Appeal after the Home Office stepped in.
Its lawyers told the court that if Epping Forest District Council was granted an injunction to stop the 138 asylum seekers living there, it could encourage other local authorities to seek similar outcomes.
Tuesday's ruling then superseded this and became a final decision on the hotel's operation.
Reacting to it, the Conservatives said the court had given a "slap in the face to the people of Epping".
Shadow home secretary Chris Philp said: "The people of Epping have been silenced in their own town."
Ken Williamson, a cabinet member on Epping Forest District Council, said the authority had been "outgunned by bigger and more powerful interests".
"What we saw in court was an unholy alliance of lawyers for government and big business intent on protecting huge profits and an indefensible asylum policy," he added.
But a Home Office spokesman said the judgement allowed it to continue its work to close every asylum hotel in an "orderly, planned and sustained programme".
Enver Solomon, chief executive at the Refugee Council, added the government needed to take a different approach towards ensuring all hotels were closed next year and described plans to house people in military sites as "unsuitable, isolating" and "expensive".