Mr Justice Eyre ruled in favour of the council, ordering that asylum seekers must be moved out of the hotel by 12 September.
The Home Secretary's last-ditch attempt to block the injunction was dismissed by the judge, despite warnings of similar applications from other councils.
The council argued that the hotel's use was a "very serious problem" and a "danger to school-age students" due to violent protests and alleged sexual assaults at the site.
Somani Hotels Limited, the defendant, plans to appeal the decision, while the Home Office highlighted the acute shortage of asylum accommodation.