Why is the Mezuzah (Scroll on the doorpost) always put on a door obliquely (slanting) and not straight?
Your question is an excellent one and requires a bit of background:
The Talmud discusses the proper positioning of the Mezuza on the door. However, the Talmudic passage is somewhat vague. As a result, two of the main Talmudic commentators from the Middle Ages disagree as to the proper understanding of the Talmud. Rashi (from the 11th century) understands the passage to mean that the Mezuzah must be placed vertical. Tosafos (actually a group of commentators who lived from about the 12th -14 century and many of who were descended from Rashi) disagrees and understands the passage to mean that the Mezuzah should be placed horizontally. Due to this basic disagreement, later authorities devised a compromise between these two opinions, namely to place the Mezuzah at a diagonal, in between vertical and horizontal, which is our practice today.
I should mention that some authorities rule according to Rashi’s understanding that the Mezuzah should be placed vertical to the door, and if I am not mistaken, Sephardim (those of Spanish descent) place the Mezuzah vertically as a matter of course.
That is the basic explanation. If you are satisfied with that response, you can stop here. If you are interested in some advanced discussion, you can continue reading:
There are some authorities who question the “compromise”: after all, if Rashi’s position is that the Mezuzah should be vertical and Tosafos’ position is that is should be horizontal, by placing it diagonally, we are following neither opinion! We have made up a third position which has no basis! For this reason, some authorities explain that our understanding of Rashi and Tosafos is incorrect! Rashi’s position is not that the Mezuzah
must be perfectly vertical, but rather that it CANNOT be perfectly horizontal. Likewise, Tosafos did not mean that the Mezuzah must be perfectly horizontal, but rather that it CANNOT be perfectly vertical. As a result, by placing it diagonally, we are in fact following both positions, and our practice is a perfect compromise!
Rabbi Yoel Spotts