Short answer: We don't know. Where does any creative artist get the idea for any of his creations?
So much for that. We'll never know how the thought welled up in Beethoven's mind that it would be a cool idea to have a choir march out at the end of the fourth movement. We do know, however, that he had been interested for some time in creating new forms of music. He had already created a hybrid piano concerto/choral work in his “Choral Fantasy,” a 20-minute piece whose words and music are very much a precursor to the Ninth; Beethoven himself said in a letter that the symphony was "a setting of the words of Schiller's immortal 'Lied an die Freude' in the same way as my pianoforte fantasia with chorus, but on a far grander scale."
Beethoven had used a text in the Choral Fantasy that praised art's uplifting influence on mankind, but he wasn't particularly pleased with it. When he came to write the choral section for the Ninth, he used the words of the great German poet Friedrich Schiller's “Ode to Joy,” but even that didn't quite meet his requirements, so he added some introductory words of his own:
Oh friends, not these sounds!
Let us instead strike up more pleasing and more joyful ones!
Being a genius didn't totally protect Beethoven from self-doubt; apparently he went back and forth a bit about whether to include the text or just have the final movement be all instrumental. How dreadful it would have been had he changed it! (And how much simpler life would be for those who have to actually manage the logistics of hiring and rehearsing a chorus to sing with the orchestra and getting them onto the stage without totally destroying the momentum of the performance!) He stuck to his original plan; I'm sure even those on the production end will agree that he did the right thing.
Probably everyone reading this post knows that Beethoven had gone completely deaf well before the Ninth's premier. He had been forced to give up his career as a virtuoso pianist and had instead begun making his living solely by his compositions. Because he couldn't hear what others were writing, he was forced to depend entirely on his own inner creativity. It isn't a stretch to say that his deafness pushed him into greatness. And while he wrote despairingly of his loss, he also said in a letter to a friend, “You must think of me as being as happy as it is possible to be on this earth - not unhappy. No! I cannot endure it. I will seize Fate by the throat. It will not wholly conquer me! Oh, how beautiful it is to live - and live a thousand times over!”
You wouldn't necessarily think that Stephen King would have anything relevant to say in this context, would you? After all, what do a writer of horror fiction and a composer of classical music have in common? One word: joy. King writes:
If there's no joy in it, it's just no good. It's best to go on to some other area, where the deposits of talent may be richer and the fun quotient higher.
Talent renders the whole idea of rehearsal meaningless; when you find something at which you are talented, you do it (whatever it is) until your fingers bleed or your eyes are ready to fall out of your head. Even when no one is listening (or reading, or watching), every outing is a bravura performance, because you as the creator are happy. Perhaps even ecstatic.
The Chorale has considered it to be an unbelievable privilege to sing this piece for two performances with the Arapahoe Philharmonic Orchestra.