Every Jewish holiday, of course, needs to have its distinctive food. Matzah on Pesach, hamantaschen on Purim and cheesecake on Shavuot. The reasons for cheesecake, however, are more obscure than those of festive foods. I found seven different reasons for the custom of eating milk foods on Shavuot, suggesting that no one knows for sure what the reason is.
Two of these are cited by the Mishnah Berurah. Firstly, Torah is compared to milk and honey by the Bible: "Honey and milk are beneath your tongue" (Song of Songs, 4:11). So on the holiday that celebrates Torah, we eat milk foods.
The other reason - my favourite - is based on the menu needs of the Jewish people after getting the Torah. Returning from Mount Sinai, they had just learned that eating meat was about to become really complicated. You needed to slaughter the animal with a special knife, rinse and salt the meat, separate the forbidden fats and veins, cook it in separate pots... who had the energy to start with all that at the end of an exhausting day receiving the Torah? So they ate what was easy, dairy foods. To commemorate that, we eat milk on Shavuot too.