Katy Norris, 30, was refused a repeat prescription of anti-depressants despite her condition worsening within days of becoming a mother for the first time.
She wanted to 'feel normal again' as she had done before becoming pregnant, Exeter Crown Court was told.
A serious case review is now being held into baby Leo Norris' death in April.
Defence barrister Adam Vaitilingam told the hearing: 'Katy Norris was diagnosed as suffering from severe post natal depression some days prior to the baby's death.
'Her previous medication was withdrawn and no further medication was prescribed.
'One can understand serious questions are being asked by those close to her as to why more was not done. They hope very much that lessons are learned and a such a tragedy will not be repeated elsewhere.'
He added: 'There is an ongoing serious case review into this case by the local health authority.'
The court heard that Norris, now 31, had suffered from depression from an early age but had had a good education and graduated from Bath University.
Prosecutor Sarah Munro said: 'Since her mid teens she has been suffering from varying degrees of depression.
'She married Neil, her husband, and was very shortly pregnant and a little boy, Leo, was born on April 10.
'During her pregnancy she continued to exhibit symptoms of depression and was prescribed anti-depression medication.
'Following Leo's birth she was initially happy at his arrival.
'But within a few days she deteriorated considerably and the medical services became involved.'
Miss Munro said that relatives from both sides of their family gave the new parents support and that her mother-in-law moved into their home in Brixham, south Devon, when Mr Norris returned to work.
On the morning that Leo was killed on April 20, Norris' mother-in-law was carrying out some household chores when the new mother went into the bedroom where Leo was sleeping.
Miss Munro told the court: 'Norris went into the bedroom where little Leo was asleep on the bed and smothered him to death with a cushion and put his lifeless body into a cupboard and told her mother-in-law what she had done.'
She later told police that following the killing she 'felt normal again' - a feeling she remembered from before the pregnancy and birth.
Norris had originally been charged with murdering Leo but that charge was substituted for infanticide which the Crown said was acceptable.
She did not appear in court in person but admitted infanticide via a video link from a psychiatric unit in Milton Keynes where she has been receiving treatment since April.
Norris admitted infanticide - the full charge being that she smothered a child under 12 months of age with a cushion while the balance of her mind was disturbed.
During the ten-minute hearing, Norris could be seen on the video link in the corner of a room in tears.
The judge, Mr Justice Jack, told her the hearing would not take very long to which she replied 'thank you'.
The judge said: 'I am satisfied by the evidence I have read in reports that Mrs Norris is suffering from a mental disorder. I am satisfied that treatment is available and remains available in Milton Keynes where she is at present.'
The judge made a Section 37 Hospital Order under the Mental Health Act.
No family members were in court to hear the proceedings.
At an earlier hearing both the judge and prosecutor described it as a 'very sad and tragic case'.
Norris had worked at Paignton Community College in south Devon as a teacher.
At the time of Leo's death, the family said: 'It is with great sadness a tragedy has happened within our close family.'