Rashi says: Rabbi Shimon bar Rebbi used to expound on this verse:
The Holy One, Blessed be He said, “The door and doorpost (mezuzah), which were witnesses in Egypt when I passed over the lintel and the doorposts, and I said, ‘For unto me the children of Israel are servants’ (Leviticus XXV, 55). They are My servants, and not servants to servants. And I brought them out from bondage to freedom, yet this man went and acquired a master for himself; let him be pierced in front of them (the door and the mezuzah-doorpost)”.
The Zohar states:
And if a man refuses to go forth to freedom, he impairs that place [from which freedom flows down to this world], since he leaves the yoke of the kingdom of heaven and accepts the yoke of a master. Therefore, ‘his master shall bring him ... to the door or the mezuzah-doorpost, since this place is the gateway to the higher world.