The gemara darshens the pasuk of כי לקח טוב נתתי לכם תורתי אל תעזובו, that the giving of the Torah is comparable to a man selling his most precious item. The gemara points out the contrast that when a man "sells" at item because he needs the money, he is saddened by the sale, whereas Hashem "gave" the Torah to the Jews and was happy about it. The Tzlach points out that the gemara is comparing apples and oranges. How does it compare the sale of a man to the giving of Hashem? The Tzlach explains that is exactly the point of the gemara. The pasuk says in Iyov (35:6) אם חטאת מה תפעל בו...אם צדקת מה תתן לו. Hashem has not benefit from our mitzvos and not loss from our aveiros. Even when we say that our aveiros causes Hashem to be weakened, that is only in His relationship to us, but it doesn't truly impact Hashem at all. The gemara is coming to illustrate that when a seller sells an object he receives payment for the object, and is nevertheless saddened by it's loss. Whereas Hashem gave us the Torah, while receiving nothing in return, yet is happy about giving it up.
Another important point in understanding this gemara is something that my wife's grandfather, Rabbi Yitzchok Gefen, develops in his sefer dalyas ha'kerem, which I also found in the Nesivos' sefer on aggadah called Emes L'ya'akov. The gemara is seemingly trying to illustrate the contrast between the reaction of a seller and the reaction of Hashem by giving up the Torah. The question is that it is not at all comparable. When a seller sells an object, that object is now in the hands of the buyer, and lost from the seller. When it comes to a חכמה such as Torah, it can be taught to the Jewish people without being lost from the giver. It is more similar to the transfer of fire where the "seller" has no reason to be upset since he didn't lose anything? The answer is that when Hashem gave the Torah to klal yisroel, he literally gave it up. As the gemara says in Baba Metzia, the ability to pasken and be machriah in Torah was handed over to the chachmei ha'torah so that even when Hashem disagrees, the halacha follows the chachmei hatorah. Hashem literally handed over the ba'alus - ownership of the Torah to the Jewish people. He had every reason to be saddened by giving up the Torah, yet His reaction was one of joy.