Alma 40:13-14
And then shall it come to pass, that the spirits of the wicked, yea, who are evil—for behold, they have no part nor portion of the Spirit of the Lord; for behold, they chose evil works rather than good; therefore the spirit of the devil did enter into them, and take possession of their house—and these shall be cast out into outer darkness; there shall be weeping, and wailing, and gnashing of teeth, and this because of their own iniquity, being led captive by the will of the devil.
Now this is the state of the souls of the wicked, yea, in darkness, and a state of awful, fearful looking for the fiery indignation of the wrath of God upon them; thus they remain in this estate, as well as the righteous in paradise, until the time of their resurrection.
This sounds like hell, doesn't it? "Weeping, and wailing, and gnashing of teeth," "the fiery indignation of the wrath of God." It's all classic "hell" imagery. Yet, this isn't the final state of the wicked. Most wicked people are bound to spend eternity in Telestial Kingdom, the lowest of the Three Degrees of Glory, and that's assuming they don't repent while they're in the Spirit World.
The Spirit World is the place where spirits go to await the resurrection. For the righteous, this place is a paradise. For the wicked, it feels like hell. In fact, I'm confident in saying that Spirit Prison, the part of the Spirit World where the wicked go, is less pleasant than the Telestial Kingdom, the Kingdom of Glory where most wicked people end up.
So what gives? Why would spirit prison, the waiting room for wicked spirits yet to be resurrected, be so much worse than "the glory of the telestial, which surpasses all understanding" (D&C 76:89), which is the final, eternal resting place of the wicked?
My guess is that spirit prison is so bad, so stereotypically hellish, because it is meant to be temporary. Consider Alma the Younger. When an angel called him to repentance, he fell unconscious, and while he was unconscious, he was "racked, even with the pains of a damned soul" (Alma 36:16). These pains helped Alma decide to repent and turn his life around, and he became a missionary and even a prophet. His pains prompted him to repent while there was still time to do so.
The same can be true for everyone in Spirit Prison. For those severed souls, it isn't too late to repent before their resurrection and final judgement. I believe that Spirit Prison is so hellish so it can more effectively convince people to give up their wicked behavior and repent. Spirit Prison is like hell so it can scare the hell out of people.
Frankly, it's a sign of God's love and mercy for Spirit Prison to be so bad compared to the Telestial Kingdom. God gives people a taste of "eternal punishment" as a last ditch effort to get people to repent. It's part of the carrots-and-sticks teaching method. The hellish torment of Spirit Prison is the biggest, spikiest stick in God's arsenal. He uses it only as a last resort, and only so long as there's still a chance of convincing people to choose a path that leads to happiness. Once that chance is spent, once Final Judgement has been passed, there's no further need for such torment. When further progress is no longer possible, there's no reason for God to push us into making progress, hence no further need for the stick. God doesn't want to subject anyone to such punishment for eternity, so He doesn't. He only subjects people to such punishment so long as there's still a chance that such punishment might convince them to repent.
The Hell of Spirit Prison exists to motivate people to do what it takes to stay out of it. God doesn't want any of His children, even the worst of them, to be stuck in such a hell forever.