Second, regarding the inquiry of the Sadducees alleging the precept, it is added: And they asked him, saying: Master, Moses wrote for us, that is, in authentic and just scripture, according to that of Ecclesiasticus twenty-four: "Moses commanded a law in the precepts of justices"; whence Deuteronomy thirty-one: "After Moses had written the words of this Law in a volume and completed it, he commanded the Levites who carried the ark of the covenant, saying: Take this book and place it at the side of the ark," etc. Whatever therefore Moses wrote is authentic, and so they put forward his scripture... as authoritative.
On account of which it is added: If the brother of anyone shall have died having a wife, and he shall have been without children, that his brother should take her as wife and raise up seed for his brother. This is written in Deuteronomy twenty-five: "When brothers shall have dwelt together, and one of them shall have died without children, the wife of the deceased shall not marry another, but his brother shall take her and shall raise up the seed of his brother, and the firstborn son from her he shall call by the name of his brother, that his name may not be blotted out from Israel."
The literal reason for this was to foster charity among relatives, to restrain cupidity, to preserve fidelity, and to maintain carnal generation. According to the spiritual understanding, our brother is Christ: Song of Songs eight: "Who will give you to me as my brother, nursing at the breasts of my mother," etc.; and the Psalm: "I will declare your name to my brothers." His wife is the Church; Revelation nineteen: "The marriage of the Lamb has come, and his wife has prepared herself." He died before the multitude of the faithful, who are the children of God: John one: "He gave them the power to become children of God," etc., and this in death: John eleven: "Jesus was about to die for the nation, and not only for the nation, but that he might gather into one the children of God who were dispersed." As the brother of this one, he who bears the care of the Church takes his wife, not to beget carnal children, but spiritual ones, as Paul says, First Corinthians four: "In Christ Jesus through the Gospel I have begotten you." And he ought to call them not by his own name, but by that of the brother, because he ought to baptize them not in his own name, but in Christ's, according to that passage of First Corinthians one: "Was Paul crucified for you? Or were you baptized in the name of Paul?" But upon him who neglects to fulfill this, the penalty of unshoeing ought to be imposed, according to that passage of Deuteronomy twenty-five: "If he shall answer: 'I do not wish to take her as wife,' the woman shall approach him before the elders of the people and shall remove the shoe from his foot and shall spit in his face and shall say: 'Thus shall it be done to the man who does not build up the house of his brother'"; because from him who does not wish to raise up the seed of Christ, the authority of preaching ought to be taken away, which is understood through the removal of the shoe, according to that passage of Ephesians six: "Having your feet shod in the preparation of the Gospel of peace." On account of which, Deuteronomy twenty-three: "A eunuch, with crushed or cut off testicles, shall not enter the Church of the Lord." On the contrary, it is said of holy men in Ecclesiasticus forty-four: "With their seed good things remain, a holy inheritance their descendants."
Source: Commentary on Luke, Chapter 20