The following is a translated quote of the last halacha in chapter 6 Mishneh Torah, Tefillin, Mezuzah and the Torah Scroll
A person should pay heed to the precept of the Mezuzah; for it is an obligation perpetually binding upon all. Whenever one enters or leaves a home with the Mezuzah on the doorpost, he will be confronted with the Declaration of God’s Unity, blessed be His holy name; and will remember the love due to God, and will be aroused from his slumbers and his foolish absorption in temporal vanities. He will realize that nothing endures to all eternity save knowledge of the Ruler of the Universe. This thought will immediately restore him to his right senses and he will walk in the paths of righteousness. Our ancient teachers said: He who has phylacteries on his head and arm, fringes on his garment and a Mezuzah on his door may be presumed not to sin, for he has many monitors—angels that save him from sinning, as it is said, (Psalms 34:8) “The angel of the Lord encampeth round about them that fear Him and delivereth them”.