The Midrash derives from the three words 'midbar,' 'esh,' and 'mayim' (desert, fire, water) that the Torah was given publicly and freely in ownerless territory — just as these elements belong to no one, so too Torah must be free and accessible to all.
וַיְדַבֵּר ה' אֶל משֶׁה בְּמִדְבַּר סִינַי (במדבר א, א), לָמָּה בְּמִדְבַּר סִינַי, מִכָּאן שָׁנוּ חֲכָמִים בִּשְׁלשָׁה דְבָרִים נִתְּנָה הַתּוֹרָה, בָּאֵשׁ, וּבַמַּיִם, וּבַמִּדְבָּר. וּבַמִּדְבָּר מִנַּיִן וַיְדַבֵּר ה' אֶל משֶׁה בְּמִדְבַּר סִינַי, וְלָמָּה נִתְּנָה בִּשְׁלשָׁה דְבָרִים הַלָּלוּ, אֶלָּא מָה אֵלּוּ חִנָּם לְכָל בָּאֵי הָעוֹלָם כָּךְ דִּבְרֵי תוֹרָה חִנָּם הֵם, שֶׁנֶּאֱמַר (ישעיה נה, א): הוֹי כָּל צָמֵא לְכוּ לַמַּיִם, דָּבָר אַחֵר, וַיְדַבֵּר ה' אֶל משֶׁה בְּמִדְבַּר סִינַי, אֶלָּא כָּל מִי שֶׁאֵינוֹ עוֹשֶׂה עַצְמוֹ כַּמִּדְבָּר, הֶפְקֵר, אֵינוֹ יָכוֹל לִקְנוֹת אֶת הַחָכְמָה וְהַתּוֹרָה, לְכָךְ נֶאֱמַר:
“The Lord spoke to Moses in the wilderness of Sinai” – why in the wilderness of Sinai? It is, that just as these are free for all mankind, so, matters of Torah are free, as it is stated: “Ho, everyone who is thirsty go to water” (Isaiah 55:1). Another matter: “The Lord spoke to Moses in the wilderness of Sinai” – it is, that anyone who does not render himself like a wilderness, accessible to all, is unable to acquire wisdom and the Torah.