Mr Justice Latham, passing sentence at Nottingham Crown Court, said she should face 'humane containment in order to protect the public - with no real prospects that a time will ever come when you could safely be released'.
Allitt, 24, of Corby Glen, Lincolnshire, murdered four children on Ward 4 of Grantham and Kesteven hospital, and made a total of 26 attacks, using injections or asphyxiation of patients to cause their breathing or hearts to stop.
After hearing medical evidence that Allitt was an extraordinarily disturbed psychopath, the judge said he would have sentenced her to life imprisonment even if she had been convicted only of assault.
Professor Roy Meadow, an expert in Munchhausen syndrome by proxy, said Allitt's symptoms were consistent with a condition in which mothers harm or invent illnesses in children in order to gain attention.
He said Allitt's medical records from 1985-91 were very bulky, revealing that she imagined some illnesses and caused others herself. She complained of abdominal pains, and convinced doctors that they should remove her appendix. They found it was normal; but Allitt plucked at the operation wound to keep it open.
She inflicted injuries to her hand with a hammer, pushed glass into her feet and injected one of her breasts with liquid. She developed an inability to pass urine, 'hysterical' in origin. A catheter inserted to help her urinate was broken deliberately and had to be removed.
Professor Meadow said the majority of Munchhausen sufferers like Allitt did not set out to cause suffering and harm. They were able to shut out the harm they caused to others, which was outweighed by the benefit they derived from intense attention.
Allitt had told Professor Meadow: 'I hate myself.' She had not admitted her crimes to herself, and was an abnormal person whose disorder would last a lifetime. But Professor Meadow said therapy could alter - though not cure - her condition. She had told him her mind was 'like a box - I can open it so far, but no more'.
James Higgins, a Home Office forensic psychiatrist, told the judge he had seen Allitt five times at Rampton special hospital. She was suffering from a psychopathic disorder, but might not meet the criteria for treatment in a special hospital set down by the Mental Health Act.
She had continued to make oblique comments and bland denials about her crimes. But during the last 24 hours before sentencing, she had begun to talk about her low self-esteem and her failure to gain employment after qualification as a nurse. She said: 'I had to prove I was better than what people thought.'
Dr Higgins said that she would probably continue to harm herself if sent to a prison. Persistent self-inflicted injuries would make inevitable her transfer to a hospital like Rampton, but Dr Higgins noted that Allitt wished to remain at Rampton and was very manipulative.
James Hunt QC, counsel for Allitt, urged the judge to view her as a patient, the prisoner of her own personality disorder.
Allitt, who had not attended her 14-week trial since 12 March, wore a purple sweater and blue jeans in the dock. She spent most of the 90 minutes staring down, but looked at the judge as he passed sentence, her hands held behind her back.