actually as the links i posted explain, kubrick originally wanted the scene because he had a soft spot for Danny and Wendy and thought they should be shown to be safe and sound at the end of the film.. that is OSTENSIBLY the reason that the scene would have been included, that's the reason he gave the co-writer of the film Diane Johnson.
i say ostensibly because as with every other time kubrick experimented with (and perfected) a genre, he used archetypal figures, events, and narrative conventions in order to undermine preconceived notions of everything we ever thought we knew about film (and everything else) while pretending to play it straight. what can be gleaned from the extensive accounts on the first link i provided is that the scene is a simple coda, a relief of tension before the mysterious tracking shot into the photo.
ullman talks to wendy and comforts her -- this is the conventional part -- but then he undermines the gesture by ignoring and placating her queries about the events of the hotel by suggesting (outright stating?) that none of it happened and they should just move on. he does the same thing to danny, talking to him which is a nice thing and then giving him a tennis ball -- what the hell, what does he know about the tennis ball and it's use in the hotel? it's a comforting gesture turned instantly ambiguous, even sinister.
this ties in with some of Rob Ager's analysis, as he uses what we knew about the deleted scene to talk about the use of animals in the film. the oversized coat that ullman wears is described as making him look like a bear, which along with a few other animals makes recurring ominous appearances throughout the film and suggest life behind the still walls/inanimate objects. this, ager describes (correctly, i reckon) was kubrick's way of incorporating King's original menacing topiary animals that come to life in the original story.
they say he spent a whole day trying to get the ball that Ullman gives to Danny to bounce the right way, and i'd be really interested to see what kind of surface the ball is actually bouncing on. the design of the carpets in the hotel, along with the layouts, maps of exteriors, and roads leading up to the hotel (MAJOR focus on this in the opening shot right? obv.) all are used to suggest the boundaries of the hotel. that is to say, whatever is going on in that location is suggested to extend to the adjacent maze, to the roads leading up to the Overlook, and beyond the mountainous terrain itself, all the way to Halloran on the other side of reality in sunny florida. his long trek an illustration of a descent into hell.
and inside the hotel, the layouts, contours and shapes on the carpet, suggest a different kind of extension internally.. the open-ended exterior landscape which introduces the film so majestically degenerates into an intricate web that ends as a closed loop.. the single tracking shot that ends the film comes (in the final/official/perfect cut) after a chase through an endless loop created by danny into which jack falls into, effectively danny overcomes the trappings of the hotel and jack by seemingly walking on a higher plane.. he is obviously the starchild. jack is absorbed into the geometry of the hotel, so much so that his frozen face becomes the gaping mouth of the elevator, an amazing contrast given his bloodless death, the final tracking shot of the film then perfectly follows a trajectory similar to the blood that would leave his mouth -- in this case his spirit, or soul, or whatever energy the hotel absorbs (maybe even his words?), flows through the hotel in the most straightforward movement in the entire film.. to end up as a lifeless photographic grin of yesteryear.
given the perfect placement of the final tracking shot contrasted with jack's death and frozen corpse, the removal of the hospital scene is understandable. but it still contains worthy extensions of the elements kubrick had been building up to that point. it primes you for the ambiguity of the final shot, and while this may have added to the feeling of wanting to think about this film forever, the weight of so much ambiguity after such a seemingly happy outcome (jack's death and danny's escape) was too much for conventional tropes to bear.