And God spoke to Moses, saying: Speak to the children of Israel and say to them, When you come to the land to which I am bringing you. It shall be, that when you eat from the bread of the land, you shall set aside a portion for God. You shall set aside a loaf from the first of your dough; you shall set it aside like the the portion that is set aside from the threshing-floor. Of the first of your dough you shall give to God a portion throughout your generations.
Although the Biblical obligation of challah does not currently apply (and, even when applicable, it only applies in the land of Israel), there is a Rabbinic obligation to separate challah from our dough at all times and places.
The medrash (בראשית רבה א:ד) states that challah is one of a small group of mitzvos in the merit of which the world was created, and they find an allusion to creation in the use of the term "reishis" - "beginning" - in the verses quoted above.
The Shelah HaKadosh (R' Isaiah Horowitz, d.1630) writes that, while we can readily understand what the Sages meant when they said that the world was created for the sake of the Torah, or for Israel (as we find in Rashi on Genesis 1:1), as these refer to broad general concepts that ultimately include everything, it is difficult to understand why challah is singled out from all the other commandments as being of such significance. Clearly, the medrash is telling us that challah represents a broader concept that, when properly understood, can be seen as ultimately including the entire Torah, and, indeed, the entire purpose of Creation.
The Shelah HaKadosh answers that man is intended to serve God by fulfilling His Torah with both his body and soul, achieving such a deveikus (connection) with God and His Torah that even the physical body becomes sanctified. Yet, asks the Shelah Hakadosh, how can the physical body ever achieve a true deveikus with the spiritual as long as it is still bound to the physical need for food? How can we truly sanctify our physical bodies when, no matter what we accomplish, our inescapable appetite for food will inevitably bring us back to our physical, animal nature?
The solution to this problem, the Shelah HaKadosh writes, is that God has given us the ability to sanctify our food, so that even when we are engaging in the physical act of eating, we are actually engaged in an extraordinary act of holiness. We sanctify our food in a wide variety of ways, including the adherence to the dietary laws and the recitation of brachos (blessings) both before and after eating. There are many times when we specifically obligated to feast and rejoice with food and drink, such as in celebration of the Sabbath and festivals. Perhaps the ultimate example of this principle was in the eating of the sacrifices in the Holy Temple.
Challah clearly represents this principle. Through the mitzva of challah we demonstrate that even our ordinary bread, being prepared for an ordinary meal on an ordinary day, is holy to God. It is only after we set aside a portion of that dough for God that we may partake of it ourselves. God, so to speak, takes part even in our most ordinary meals, for a proper Jewish home is a Temple to God, and a proper Jewish table is an altar to God, and, at a proper Jewish meal, every bite of food that we consume is a holy korban (sacrifice) to God.
Once we fully grasp this concept, we quickly recognize that this principle lays at the foundation of virtually everything we do as Jews. For a Jew, there is no fundamental conflict between the physical and the spiritual. On the contrary, our task as Jews is precisely to bring these apparently disparate elements into unity with each other through the fulfillment of the mitzvos. For the Jew, therefore, religious life is not limited to the synagogue. On the contrary, the essence of Judaism is precisely what we do outside of the synagogue, in our homes and our businesses and in the public sphere.
Thus, we can understand why the medrash says that the world was created in the merit of challah, for through the mitzva of challah we can recognize this vital principle which, ultimately, includes the entire Torah and, indeed, the entire purpose of Creation.