The Gemara on 38a states:
Jose son of R. Hanina said: The Torah was given only to Moses and his seed, for it is written, write thee these words [and] Hew thee: just as the chips are thine so is the writing thine. But Moses in his generosity gave it to Israel, and concerning him it is said, He that hath a bountiful eye shall be blessed, etc. R. Hisda objected: And the Lord commanded me at that time to teach you statutes and judgments? — He commanded me, and I [passed it on] to you. [A further objection:] Behold, I have taught you statutes and judgments, even as the Lord my God commanded me? — He commanded me, and I taught you. Now, therefore, write this song for you! — This refers to the song alone. That this song be a witness for the against the children of Israel? — But only the [Scripture] dialectics [were given to Moses alone].
To summarize: The Gemara tells us that the Torah was given only to Moshe Rabbeinu and his descendants, meaning, he didn’t have to teach the Torah to the entire nation. But out of Moshe’s great generosity, he did teach the Torah to the entire nation. The Gemara then proves from a passuk that clearly the Torah was meant for the entire nation. What Moshe didn’t have to share was the dialectic method of Torah-study called “pilpul.”
Now the Maharsha makes this Gemara a bit less mysterious by explaining that undoubtedly the Gemara always knew that all the mitzvos of the Torah were meant for the entire Bnei Yisroel. Rather, the Gemara initially thought that the art of Torah study was something Moshe could’ve kept for himself. The Gemara then proves that in fact Torah study, too, was something the whole nation had an automatic right to; it was only the specific type of study called pilpul that Moshe could’ve kept for himself.
However this Gemara still appears to remain in the realm of mystical Kabbalah–for how could it be suggested that Moshe Rabbeinu would’ve kept the mitzva of Torah study for himself (without a great act of generosity)? Surely Moshe Rabbeinu’s highest priority was that the Torah perpetuate through all the generations. How then could it be suggested the Moshe Rabbeinu may have kept the Torah for himself–a decision that likely would have endangered its very survival?
I believe the answer is that there is no question that on the intellectual level Moshe knew with 100% clarity that he was obligated to disseminate the Torah to the entire nation. On the emotional level, however, Moshe Rabbeinu would understandably have wanted to keep the Torah for himself. This is because of the fact that Moshe, more than any mortal, understood the true value of the Torah.
Imagine you were given a suitcase containing a million dollars in cash, and you were told that by distributing the money throughout a plague-stricken community, you would save them from imminent death. Obviously you would do the right thing and immediately give away the money. But you still couldn’t be blamed for having a fleeting desire to keep the money for yourself. So it was with Moshe: to him, the Torah was diamonds; more precious than diamonds, and so it took a bold act of generosity disseminate it–pilpul and all–to the whole nation. It wasn’t simple to let it go.