Sideways world is not purgatory. It's just an alternate timeline. Life is purgatory, and it is experienced as a series of timelines in which we try to improve our decisions until we can see the light and become one with the universe. At least, I think that's the message.
For starters, we have evidence that people can die in sideways world, since Sayid killed Keamy and his goons. So that by itself rules out the purgatory theory for me.
Even more compelling, we have evidence from Season 2-3 that when Desmond is exposed to the island's EM properties, he is able to move through time and even perceive multiple alternate timelines, as was the case when he foresaw multiple death scenarios for Charlie. Therefore, when Widmore zapped Desmond with EM in Season 6, it follows that Desmond stepped into an alternate timeline (not the afterlife!)
The alternate timeline of sideways world is as follows:
In 1977, even though the grown up 2007 version of the Losties were running around on the island, there were simultaneously 1977 little kid versions of themselves co-existing off island (we know this because we've seen time traveling Losties observe past versions of themselves). When the jughead explosion went off, the island sank, and a new alternate timeline was created in which all the island events from 1977 onward no longer affected the off-island reality. Numerous members of the Dharma Initiative and the Others evacuated in this timeline and lived different lives off-island. The same island forces that moved Jack et al back to 1977 moved them forward to 2007 just as the bomb went off, however this was already an established timeline in which everything we saw in the first 5 seasons happened the way we saw it. (I think there is a scene in Back to the Future 2 where Doc Brown talks about different stream of time forking off, the jughead explosion was an event similar to Biff getting ahold of the sports almanac).
When Miles read Juliet's spirit as saying "it worked", I take that to mean that when she died she was simultaneously experiencing the blissful final ending in the alternate sideways world timeline, which they had just created by setting off the bomb. I think sideways world is the timeline that "only ends once" for most of the main characters, because they've gone through the process of making the correct choices, kind of like Bill Murray in the final act of Groundhog Day. Some people, like Ben, just had to stay in this timeline a little longer in order to finally get it right and embrace the light.
I think what the show is telling us is that life itself is purgatory. Life is experienced through multiple iterations of a timeline that "only ends once", and everything up until that ending is just progress. This is consistent with some of the references to eastern religions. Also, if one were to really delve into it, I think a lot can be extracted from the show's references to social thinkers/philosophers (Locke, Rousseau, Hume) who grappled with how to redirect people's inner greed into social good.
Even though Jack experienced the final ending in sideways world when he died on the show, we know that the timeline we saw him die in lived on and had numerous other things happen. Hurley became the new guardian, with Ben as his sidekick, and presumably better choices were made about how to run things (we know Jacob was flawed, and Jacob's predecessor was even more flawed). Hurley potentially carried thousands of years of additional experiences with him when he experienced his final ending in sideways world.
I am also thinking that the show is holding out the human mind as a microcosm of the entire universe. This ties into some of the taoist themes of the show. Viewing the series as a whole, it begins with Jack's eye opening, and it ends with his eye shutting. This symbolizes life and human experience, which is a purgatory like existence until people achieve oneness with the universe.
At least, I think that's the message .