I assume that if it is a place where a murderer is also housed, then she has done something illegal and has been found "criminally insane." To be found criminally insane you must have committed a crime and it's proven that you had no idea at all the consequences of right/wrong and are usually not fit to stand trial.
I know there was a lady who killed all of her children (I can't remember if she's the one who drowned them in the bathtub or something else.) Anyway, she isn't in prison, she's in a hospital. Because she was suffering from sever post pardum psychosis when the act happened. She's not capable of living on her own and has commited a horrible crime, yet at the same time it was caused by mental illness and now she lives forever in grief because she had no idea what she was doing when it happened.

(It is definately a story of the system failing her and her children....)
Also, it's not easy to get hospitalized like that for a crime, even when it's obvious that was what was happening.