The Rishonim, the Rambam, Sefer Hachinuch, and more, explain the reason of Sefiras Haomer as yearning and preparing for Kabbalas Hatorah.
Shavuos is the pinnacle of the year. We are busy all year learning and doing Mitzvos. Shavuos is the time when we received this cherished gift. The counting of the Omar is our yearning and anticipating of the special day.
The Zohar Hakadosh teaches that it’s a counting of Taharah to purify ourselves to receive the Torah anew on Shavuos.
דרך ארץ קדמה לתורה. The days of the Sefirah are a time to purify our Middos so we can then be Mekabel the Torah anew. The Middos is not only about character traits, they encompass all of a person’s emotions. As is known, every week has its Middah. The emotions are divided in six and the seventh Middah represents action.
Chassidus teaches another layer to Sefiras Haomer based on the Ari Hakadosh.
From time to time Hashem sends to a person inspiration that is higher than the level that the person is now. This inspiration is meant to give a person a glimpse of the next level so that he will yearn to be at that level and work on reaching it. But this inspiration doesn’t last. It can’t last because the person is not yet on that level.
After the inspiration leaves, a person has to work with his own Avodah and with Tefillah to Hashem to reach that level. By not having the inspiration and still yearning for it and working on it, that itself is part of the Avodah to be Zoche to reach it. Once the level is reached, the cycle starts over for the next level.
This happens Pesach, Sefirah, and Shavuos. On Pesach we are given the Ohr as a gift without our being in the higher level so that we taste it. Then it is taken away. Throughout the Sefirah our Avodah is to work on ourselves and yearn for the higher level. On Shavuos it all culminates; we reach the level that we tasted on Pesach through our own Avodah and Hashem sends inspiration for the next level.
יה”ר that we should be Zoche!