A judge delivered the ruling on Wednesday after junior doctors complained that the Health Secretary wrongly imposed the contract on NHS employers.
Justice for Health, a group founded by five junior doctors, said Hunt acted beyond the scope of his powers by compelling NHS employers to adopt the new contract.
Hunt said before the ruling that the complaint was without substance and should be dismissed.
Mr Justice Green, who analysed evidence at a High Court hearing in London last week, ruled in favour of the government minister.
Justice for Health, founded by Dr Nadia Masood, Dr Ben White, Dr Fran Silman, Dr Amar Mashru and Dr Marie-Estella McVeigh, had argued that Hunt’s decision to impose the contract lacked a sound or rational foundation and should be quashed.
Hunt said he approved a new contract but has not imposed it on employers or compelled them to adopt it.
“Nor will it quell junior doctors’ concerns about the imminent introduction of a flawed contract they have rejected, or the deep sense of anger and mistrust that has built up towards the government over the last year.
“Faced with a demotivated and frustrated workforce, the government must prioritise rebuilding the trust that has been lost with a generation of junior doctors – the GPs and hospital doctors of the future.
“As a first step towards this, it must address junior doctors’ continuing concerns with the contract.
“With the NHS facing unprecedented pressure, it is critical to focus on how to assure its long-term future. Junior doctors are central to this. If even a small number choose to vote with their feet, this future looks increasingly uncertain.”
Junior doctors began strikes, the longest of which has lasted two days, in January.
The BMA has suspended industrial action by junior doctors planned for October, November and December.