The holiday of Shavuot is distinct among the major festivals of Jewish life in that it has no obvious distinctive ritual elements. Whereas Pesach has its seder and marror, and Sukkot has its, well, sukkot, Shavuot is not given any particular unique commandments, not in its Biblical textual source, nor in the halachic sources.
In the Rabbinic texts, however, this holiday was considered to be related to the date of the giving of the Torah at Sinai (although even that is somewhat problematic; the Talmud calculates the actual event as being the day after Shavuot).
Given that the holiday was felt to reflect the giving of the Torah, it became customary in many communities to study Torah all night and then read the text relating to Sinai in the morning service at dawn. The source for this is found in the Midrash (Shir hashirim Rabba 1:57 and Pirkei D’Rav Elazar 40), where it explains that the night prior to Sinai was short, and sleep was sweet, so the people of Israel slept that whole night. The halachists (Magen Avraham 494) understood this as a mistake on the part of the people, that they should have been awake in anticipation, and to rectify this, we stay up all night each year on that night.
R. Zadok HaCohen of Lublin felt that the source material did not support the idea that there was a sin committed by the people nor that staying awake is meant as a punishment or paybck; there is no suggestion in the Midrashic texts that an error was committed by this sleep. In fact, in a reading echoing the Lacanian inversion of the Freudian approach to dreams versus reality (which we dealt with at length in Perashat Vayetze), R. Zadok flips this reading on its head. In short, Freud argues that dream work is a defense mechanism by which continued sleep is ensured by repressing thoughts that may be disturbing to the individual, whereas Lacan argues that the opposite is the case–during dream activity we come face to face with our Real, whereas during the day we are able to maintain all our defenses in order to get through the day. This same Lacanian inversion is operative in R. Zadok’s reading.