The answer to this Rashi seems to be that when it comes to aiding others in their spiritual growth, not only does Hashem reward someone with the external merit of what others accomplished, He gives the person all the tools he needs to accomplish his mission. Moshe was the representative of the multitude and was therefore allowed access to the highest level of Torah knowledge and understanding – not in his own merit but in the merit of the entire nation.
As important as Moshe Rabbeinu was, he was a man, and man isn’t allowed access to the upper worlds. When the Jewish nation was deserving, Moshe represented it and therefore was allowed to enter the Heavens. He was the conduit for bringing Torah to the multitudes. Once the Jews fell from that level, they were no longer worthy, so he as their shaliach was no longer permitted in Shamayim. It wasn’t as a punishment to him but a reality. He no longer had the merit of that great nation catapulting him to those heights.
We see a powerful concept from this Rashi. When you help other people grow, not only do you receive reward for everything they accomplish, you receive S’yata D’Shmaya to do things that you might not have been able to otherwise. Whether as a rebbe teaching a difficult Gemara, a worker for the klal taking on a bold project, or a parent trying to create a wholesome environment for his or her family, the merit of the entire group works in your favor, and you will be able to do things that would otherwise be unthinkable.