France's Council of State or Conseil d'Etat - said the state's failure to provide for the migrants' basic needs "exposed them to inhuman and degrading treatment, dealing a serious and clearly illegal blow to a basic right."
The court noted that migrants, "who find themselves in a state of destitution and exhaustion, have no access to running water, showers or toilets and cannot therefore wash themselves or their clothes."
The situation had caused some to develop skin diseases such as scabies and impetigo or infected wounds, "as well as serious psychological troubles," the council found.
The Council of State upheld a 26 June order by a court in the northern city of Lille for the state to supply the migrants with running water, toilets and showers.
The Lille court also demanded that those migrants who decide to seek asylum in France be offered a place in a reception centre wherever there was space available.
Several hundred migrants are camped out in and around Calais -- the main launchpad for attempts to smuggle across the Channel to Britain by truck.
The interior ministry and the city of Calais had appealed against the Lille court's ruling in June, saying the provision of services would lead to the proliferation of new "Jungles", as the sprawling makeshift camp demolished last year in Calais was known.
The case was taken by a group of migrants and NGOs, who complained that the state was violating the migrants' basic rights.
France's new government has taken a tough line on Calais, with Interior minister Gérard Collomb saying he does not want the city to become an "abscess".
Last week, President Emmanuel Macron softened his tone somewhat, saying he aimed to find shelter for all those living on the street by the end of the year.
- with AFP