Modified from an earlier answer
Interestingly enough, although the Third Reich castigated Freud and his psychoanalytic theories as "Jewish science" the psychiatric profession actually expanded under the auspices of the Third Reich and the state ended up promoting psychotherapy. By the 1930s, the psychiatric profession had become so institutionally entrenched in German society that dismantling the system was a non-starter for the new regime and it instead co-opted those medical professionals that remained in Germany.
The biological essentialist dogma of national socialism approached issues of mental health from a physiological approach. In other words, a sick mind was a result of a sick or polluted body or congenital madness was a function of defective genes. The German psychiatric profession as a whole was able to adapt to these mores shockingly well after it had purged itself of its racial and political undesirables. German psychiatrists presented their work as healing individual members of the Volksgemeinschaft, which was their birthright as members of the Aryan race. Taking the Third Reich's precepts at face value, a healthy Aryan could not have a congenitally "disturbed mind" because they were members of a superior race. Under the auspices of the Reichsmarschall's cousin, Matthias Heinrich Göring, the Göring Institute became one of the leading centers for psychological therapy within the Third Reich and received funding from the Deutsche Arbeitsfront . M. H. Göring would turn the institute into a relatively pliant servitor of the state and would "cure" homosexuals or treat the nervous disorders of the Third Reich's elite. The state also employed psychologists to screen out those unfit for promotion in the military as the military expanded, reaching a peak of about 500 employed by the Wehrmacht in 1941.
The narrative of German psychiatrists meshed well with the experience of other scientific and medical professions in the Third Reich. The state demanded a degree of self-coordination and these professionals received a degree of state sanction of their professional expertise. This also entailed a degree of involvement into the state's murderous actions. Members of the profession engaged in the T4 Euthanasia program. Edith Sheffer is currently working on a project with the tentative title "No Soul": Hans Asperger, Death, and the Origins of Autism in the Third Reich which contends that the Asperger's disorder scale, which measures the ability to function normally in a social environment, was developed in part as a diagnostic tool for euthanasia. Other patients in German asylums who lacked a prominent protector could find themselves sterilized or murdered as part of the state's "pruning" an undesirable element out of the Volksgemeinschaft.
For medical professionals whose ideas meshed with that of the regime, they found themselves able to access the corridors of power and get state funding. For example, the Swiss-born Ernst Rüdin was a prominent professor of psychiatry at the University of Munich and in the 1920s had emerged as a popular advocate of eugenics as a proactive measure against mental disorders like schizophrenia. These ideas led to Rüdin's close involvement in the Interior Ministry over racial hygiene and his directorship of various medical associations. Yet state support was for many medical professionals a Faustian bargain in the Third Reich for these professionals could largely conduct research only into channels approved by the state. This fostered a degree of conformity within the profession as individuals would seek to adjust to the new reality of operating under a dictatorship.
Source
Cocks, Geoffrey. Psychotherapy in the Third Reich: The Göring Institute. New York: Oxford University Press, 1985.
Geuter, Ulfried. The Professionalization of Psychology in Nazi Germany. Cambridge: Cambridge University Press, 1992.
I am not sure about insane asylums but I can attest to the fact that they were forcibly sterilized. Granted this was also common law in other places in the world at the time, but they did do this. This was before the war, during the war though there were ""Euthanasia" Killings". Between 1939 and 1945 about 200,000 to 250,000 mentally and physically ill persons were murdered.
I used the United States Holocaust Memorial Website for my statistics: http://www.ushmm.org/wlc/en/article.php?ModuleId=10005200