Torah Study Shavuot Night
Perhaps the most prominent custom of the Shavuot holiday is to stay up at night studying Torah. This custom is mentioned in the Zohar, which explains the importance of this custom by an interesting analogy (Zohar on Emor III:97-98).
The Zohar likens the period of counting Omer to the process of a woman going through her monthly period of purification. At the beginning of this period, there is a need for separation due to the actual cause of ritual impurity. After- wards, there is a period of seven clean days. Then the woman is able to immerse, and afterwards she is permitted to be with her husband. The Zohar understands these as spiritual steps: the seven clean days are a kind of psychological and spiritual preparation to return to a state of full togetherness; even when this readiness is achieved, there is still a need for the act of purification. Purity is not just the lack of impurity; it can be achieved only through active participation.
This is parallel to the process involved in the redemption from Egypt. In Egypt the Jews were at first actually involved in an Egyptian lifestyle which was an active source of spiritual defilement. Then they brought an end to this alien influence when they brought the Pesach sacrifice. (See Rashi on Shemot 12:6.) Afterwards they began the seven week period of psychological and spiritual preparation for receiving the Torah, reaching the stage where they were willing to proclaim, "We will do and we will listen!" (Shemot 24:7.) Finally they purified themselves in the three days of separation.
According to the Zohar, we go through this same process each year, though on a smaller scale. At Pesach we receive a certain spiritual enlightenment from on high which can move us towards holiness; afterwards we begin to count the Omer, each day corresponding to a further rung on our climb towards perfection. If we have carried out the count properly, counting each night to devote each full day to another step upwards, then on Shavuot we are fully ready to receive the Torah.
Torah study on Shavuot night corresponds to immersion in a mikveh. One way of understanding this is to suggest that the stages of ascent we go through during the Omer period are primarily connected to our personal qualities and interpersonal behavior, not specifically to Torah. This makes sense on several levels. First of all, immediately following the Exodus we had not yet received the Torah. Second of all, it would constitute a repair which exactly corresponds to the flaw behind the mournful character of these days: the students of Rabbi Akiva who failed to treat each other with respect. (Yevamot 62b.) Also, it is specifically during these days that we study Pirkei Avot, which focuses particularly on our character traits. Finally the days and weeks are numbered according to those spiritual qualities known as "midot", corresponding to our personal characteristics which we also call midot.
However, as we well recognize from today's pop spirituality, "personal growth" can also be a kind of idolatry. Before we receive the Torah, we need to demonstrate that our personal growth is not an end in itself but rather a means to make us worthy of hearing and carrying out HaShem's will, by accepting the Torah. We show this by not counting Omer on the final night but rather by immersing ourselves in Torah study.
It is interesting to note that the Zohar does not state that all should spend the entire night in study. It states that this was the special level of the earliest pious ones, the chasidim rishonim. This observation reinforces the general recommendation based on the revealed Torah, that a person shouldn't stay up all night if this will prevent interfere with performing mitzvot properly - for example, if tiredness prevents proper concentration during prayer or the Torah or Megillah reading.