In the not too distant past, prior to modern Mental Health legislation, it was all too common for women to be committed to an asylum because of pregnancy. It only took one doctor and one family member, or a person in loco parentis, to sign the relevant papers.
When I first worked in a Psychiatric Hospital in the middle 1960's there were a number of elderly women patients who were totally institutionalised due to their long stay but who had no psychiatric diagnosis. Looking at their records most of them were admitted when well under 20 years of age, had been working as a servant in a big house and were pregnant.
The story passed on by more experienced staff and, sometimes gathered from conversation with the patients themselves, was that they had become pregnant ( not always as a result of consensual activity ) by a son of the wealthy man who owned the house (some claiming it was the man himself). In those days before free health care, the local doctor would depend on such people for the majority of his income and with the wealthy man able to sign in loco parentis it was very easy to remove the problem.
To be fair to those who signed admission papers it is possible (probable?) that some of the servants had suffered mental health problems because they would have been well aware of the consequences of pregnancy in those circumstances and were subsequently committed to the asylum for genuine health reasons.