That's the usual received wisdom. However, back in the old days there was some research in to treating various mental disorders with LSD. Here's an example of treatment of childhood schizophrenia with LSD and psilocybin: [1]
LSD has also been used to treat alcoholism (with the most famous case being that of Bill Wilson, the founder of Alcoholics Anonymous).
All of these studies were done decades ago, so I'm sure contemporary scientists would have lots of objections regarding their methodology, ethics, and so on. But the early studies do show promise, and I hope one day these avenues of research will be further explored with modern tools.
Even now there is ongoing research in to using psilocybin to treat depression and end-of-life anxiety in cancer patients.
Of course, it is important to note that such research was in to using psychedelics in a therapeutic setting, with trained, experienced therapists, and not just haphazardly taking psychedelics to "get high", "party" or "have a good time". The results of haphazard use without proper guidance, particularly for people with mental health issues, is likely to be far riskier.