I don't mean religion itself as madness. But a growing awareness of reality and self, combined with a lack of answers and understanding of the true nature of such reality and self, can foster an unstable mentality that a belief system can fill. Whether or not it's true isn't necessarily the issue, as long as that illusion is maintained.
Are there answers that you're seeking, or are you simply curious?