I was not feeling suicidal when I first took MDMA but I had been struggling with depression for years, and the experience was a key step on the way out. It was such a clear demonstration of the degree to which my perception of the world around me, and my estimation of the beauty and worth to be found there, are driven by the chemical state of my brain. I had thought that I was depressed because I lived in a crappy world; that first MDMA experience showed me that I had causality backward, and that I thought the world was crappy because I was depressed. Insight that produces lasting change indeed.
This is really a very important reason to do drugs in the first place, especially psychedelics. They show you how much of your reality/perception is based on a temporary chemical/biological state, not what you previously thought of as 'reality.' It also teaches you to 'ride it out' in the event of a bad trip (also a valuable experience). Ironically to some, doing drugs like this can make you more sane.