"Vayechezu es ha'elokim vayoch'lu vayishtu" -- "And they [the great men of Israel] saw [the presence] of G-d, and they ate and drank" (Mishpatim 24:11). Midrashim and commentaries interpret these verses in diametrically opposite ways. Rashi, quoting from Midrash Tanchuma, explains that they viewed the Shechina in an inappropriate, haughty manner. However, many others (see Ramban, Sforno, Rashbam, and Targum Onkelos) explain that after witnessing the Divine Presence (or after their sacrifices were accepted), they rejoiced with food and drink (or as if they partook of food and drink).
The component of joy that accompanies an encounter with the Shechina appears frequently throughout the Torah as a central element in 'avodat Hashem. Rav Yosef Dov Halevi Soloveitchik, zt"l, explained that the very definition of true simcha is "lifnei Hashem" -- when one is in the presence of the Shechina. Hence, the Torah on numerous occasions, states "u'smachtem lifnei Hashem" -- "and you shall rejoice in the presence of G-d."
The component of simcha, although important in the performance of all mitzvos (e.g. see Rabbeinu B'chaye in his introduction to Parshas B'ha'alos'cha), is especially significant concerning the mitzva of talmud Torah. Rambam, in his Seifer HaMitzvot (Mitzvas 'Asei 3), describes how one can fulfill the commandment to love G-d. "shenachshov v'nisbonein b'mitzvosav ... ad shenasigaihu v'nehene b'hasagaso b'tachlis ha'hana'ah" --- "that we should think and analyze his mitzvos (a reference to talmud torah) ... until we understand it and enjoy its attainment with an extreme degree of pleasure." Here, as opposed to other mitzvos, we find the component of pleasure and joy in the very description of the mitzva itself. The words of R. Avraham of Sochatchov in his introduction to Eglei Tal are well known. One should not think that the joy experienced through talmud Torah demotes the mitzva to a state of shelo lishma, not for the sake of heaven. The opposite is true. The purpose of the mitzva is to experience joy.
An even more striking statement appears in the commentary of R. Avraham min Hahar to Maseches N'darim (36b). The Mishna there states that a mudar hana'a mei'chaveiro -- one who is proscribed from receiving benefit from his fellow by dint of a neder -- may not use his sifrei kodesh. Now, mitzvos lav leihanos nit'nu -- generally, we don't view the pleasure received through mitzva performance as benefit vis-a-vis the prohibition of n'darim. Why, then, can he not use his s'farim? Whereas other Rishonim offer different answers, R. Avraham min Hahar resolves the difficulty with the above principle. Unlike other mitzvot, the mitzva of talmud Torah was given precisely so that the student of Torah should be "mishtashei'a bid'var Hashem" -- delight in the word of G-d. He proceeds to quote T'hillim (19). "Pikudei Hashem y'sharim, m'sam'chei leiv" -- "the commandments of Hashem are upright, they gladden the heart!"
The author of Mesillas Y'sharim opens his classic mussar work with the statement that man was created "l'his'aneig 'al Hashem" -- to enjoy Divine pleasure in 'Olam HaBa. Midrash Tanchuma (Ki Savo 4) notes that the Torah really should have not been given in 'Olam HaZeh since Hashem will teach Torah to all in 'Olam HaBa. However, it was given to B'nei Yisrael in this world so that we should understand the Torah in 'Olam HaBa. Now, the World to Come is the world of "nehenin miziv ha'shechina" (Brachos 17b) -- enjoying the Divine radiance (which interestingly is derived from the above-qouted verse in our parasha). The direct implication is that limud haTorah is equivalent to "nehenin miziv ha'shechina." This Midrash, too, highlights for us the great pleasure and joy inherent in Torah study. It is no less than a slice of 'Olam HaBa right here in this world.
The centrality of pleasure and joy relating to talmud Torah and Hakbalas P'nei HaShechina in the Mikdash would appear to be related for talmud Torah is also an encounter with the Shechina (see, for example, Nefesh Hachayim 4:6). In the temporary absence of a Beis HaMikdash where the Shechina dwelt, only the Torah can serve as the vehicle for the encounter with the Divine. Thus, it is not surprising that joy is so crucial regarding both of these commandments.