Millennials are, on average, conditioned to fear and despise organized religion because it tends towards orthodoxy. And then over the last ten years the secular left has degenerated into orthodoxy complete with antiproductive morality goals (see also: diversity quotas, SJWs, cisgender).
So in answer to your question is religion a mental illness. No. It can be used by demagogues to prey on mental weakness, but then again so can most things in this life.