I can't find any justification for ending the show this way, other than the writers wanted to end the show on a twist ending, rather than just another typical ending. As for the snow globe, that was the focus of Tommy's attention.
The problem that I see with the ending is that they explained away the whole show as the daydreams of an autistic child's imagination. The thing is, autism was - and still is - largely not understood what goes on in a person's brain. Because a lot of autistic children are withdrawn, it seems as though they're in their own world. This is not likely the case (I'm not going to search for links to autism websites for this answer), but for writers looking for some weird ending for their show (other than "it was all a dream"), the idea of a child imagining the world of St. Elsewhere seemed like an easy out.
BTW, in the Wikipedia article about the last episode, someone estimates that "90% of the shows existed in this kid's head" due to the many show crossovers. I actually have an easy answer for that - assuming that the 'real world' has shows like Cheers and MASH on TV, it's entirely plausible that Tommy took characters from those shows after seeing them on TV and made them part of his imagination.