He wanted a tribunal to approve a move to a Scottish prison, but Ashworth Hospital said he had chronic mental illness and needed continued care at the Merseyside top-security facility.
Brady, now 75, and Myra Hindley, who died in prison in 2002, tortured and murdered five children.
He was jailed for three murders in 1966 and has been at Ashworth since 1985.
He and Hindley later confessed to another two murders.
Judge Robert Atherton, who headed the three-person mental health tribunal at Ashworth, said: "The tribunal has concluded that Mr Ian Stewart Brady continues to suffer from a mental disorder which is of a nature and degree which makes it appropriate for him to continue to receive medical treatment, and that it is necessary for his health and safety and for the protection of other persons that he should receive such treatment in hospital, and that appropriate medical treatment is available for him."
The reasons for the tribunal's decision will be released later.
By Dominic CascianiHome affairs correspondent
Ashworth Hospital argued that Brady was after "a win" over the authorities. This decision, which denies him that victory, comes down to the very narrow legal remit that had to be fulfilled by his mental health tribunal.
The panel had one simple duty: to assess the patient's health and what would be clinically right for him.
So although we have not yet seen the full reasons, the tribunal's decision means it has decided that Brady is still suffering from paranoid schizophrenia or another treatable disorder.
Once it had come to that conclusion, it could further rule that it would be appropriate to keep Brady at Ashworth, either to receive treatment or because it would be necessary for his own safety or those of others.
It's going to be very difficult for him to challenge the decision because he can only launch an appeal if he can show that the tribunal got the law wrong.
Brady has the right to challenge the decision.
Dr David Fearnley, medical director at Ashworth, said: "We appreciate the time and effort the mental health tribunal has given to this case and its judgment is consistent with the expert opinions of our clinicians.
"Mr Brady suffers from a severe personality disorder and a mental illness which still require high-quality care.
"It is a testament to the staff of Ashworth Hospital that we have been able to stabilise his schizophrenia to the degree we have. However, his condition is chronic and will require this support for the foreseeable future."
Asked if the tribunal, which was held in public at Brady's request, may have exacerbated the illness, Dr Fearnley said: "I think the difficulty with an individual such as Ian Brady is that he has a complex mental disorder and for many years has been able to publicise his concerns.
"However, we see this as part of an overall problem which our experts are looking into and will continue to provide expert care."
Brady has been on a hunger strike since 1999, and appeared at the tribunal with his feeding tube in place. The tribunal heard that he also eats some food on "most days".
Dr Fearnley said his treatment was under review by the specialist team, including the issue of feeding.
Brady and Hindley's crimes of sexual abuse, torture and murder of children shocked the nation.
Lesley Ann Downey, 10, John Kilbride, 12, Keith Bennett, 12, and Pauline Reade, 16, were all sexually assaulted before their deaths at the hands of the couple.
Their bodies were buried on Saddleworth Moor, near Manchester, although Keith Bennett's body was never found.
Their final victim, Edward Evans, 17, was murdered in front of Hindley's 17-year-old brother-in-law, who alerted the police.
Keith's mother, Winnie Johnson, made repeated calls for Brady to reveal the location of his grave. She died last year, aged 78, without knowing where her son's remains are.
Her solicitor John Ainley said he thought she would have been "satisfied" by the tribunal's decision.
"She always felt that Ian Brady did not give the children any choice and consequently he should not have the choice to leave the hospital environment."
Terry Kilbride, the brother of John, said Brady should stay in hospital.
"I don't believe he's going to kill himself, that's just a ploy, just another wind-up.
"I think to be honest he should go back to hospital, I think that's where he belongs, in the hospital, and keep him alive as long as possible because it's only him that knows where Keith Bennett is."
Brady gave evidence for more than four hours at the tribunal, which sat at Ashworth psychiatric hospital in Maghull. It was the first time he had spoken in public for 47 years.
Brady had told the tribunal he used "method acting" to trick doctors into classing him as insane so he could be transferred from prison to hospital.
But he said he now wanted to leave Ashworth because he hated it and "the regime has changed to a penal warehouse".
The tribunal heard from Brady's lawyer that Brady had a severe personality disorder but was not mentally ill and could be treated in prison rather than hospital.
During his evidence, Brady refused to answer a question from his own lawyer about whether he intended to take his own life if he was declared fit to return to prison.
Correction 25 July 2013: An earlier version of this story wrongly suggested Ian Brady's legal fees cost Â£250,000.
Moors Murderer Ian Brady has lost his legal bid to be transferred from a psychiatric hospital back to prison.