I answer that, There are two things to be weighed regarding the aforesaid movements: one on account of which they necessarily prevent a man from receiving this sacrament; the other, on account of which they do so, not of necessity, but from a sense of propriety.
Mortal sin alone necessarily prevents anyone from partaking of this sacrament: and although these movements during sleep, considered in themselves, cannot be a mortal sin, nevertheless, owing to their cause, they [sometimes] have mortal sin connected with them; which cause, therefore, must be investigated. Sometimes they are due to an external spiritual cause, viz. the deception of the demons, who can stir up phantasms, as was stated in the First Part (I, Q. 111, A. 3), through the apparition of which, these movements occasionally follow. Sometimes they are due to an internal spiritual cause, such as previous thoughts. At other times they arise from some internal corporeal cause, as from abundance or weakness of nature, or even from surfeit of meat or drink. Now every one of these three causes can be without sin at all, or else with venial sin, or with mortal sin. If it be without sin, or with venial sin, it does not necessarily prevent the receiving of this sacrament, so as to make a man guilty of the body and blood of the Lord: but should it be with mortal sin, it prevents it of necessity.
For such illusions on the part of demons sometimes come from one's not striving to receive fervently; and this can be either a mortal or a venial sin. At other times it is due to malice alone on the part of the demons who wish to keep men from receiving this sacrament. So we read in the Conferences of the Fathers (Cassian, Collat. xxii) that when a certain one always suffered thus on those feast-days on which he had to receive Communion, his superiors, discovering that there was no fault on his part, ruled that he was not to refrain from communicating on that account, and the demoniacal illusion ceased.
In like fashion previous evil thoughts can sometimes be without any sin whatever, as when one has to think of such things on account of lecturing or debating; and if it be done without concupiscence and delectation, the thoughts will not be unclean but honest; and yet defilement can come of such thoughts, as is clear from the authority of Augustine (Obj. 1). At other times such thoughts come of concupiscence and delectation, and should there be consent, it will be a mortal sin: otherwise it will be a venial sin.
In the same way too the corporeal cause can be without sin, as when it arises from bodily debility, and hence some individuals suffer seminal loss without sin even in their wakeful hours; or it can come from the abundance of nature: for, just as blood can flow without sin, so also can the semen which is superfluity of the blood, according to the Philosopher (De Gener. Animal. i). But occasionally it is with sin, as when it is due to excess of food or drink. And this also can be either venial or mortal sin; although more frequently the sin is mortal in the case of evil thoughts on account of the proneness to consent, rather than in the case of consumption of food and drink. Hence Gregory, writing to Augustine, Bishop of the English (Regist. xi), says that one ought to refrain from Communion when this arises from evil thoughts, but not when it arises from excess of food or drink, especially if necessity call for Communion. So, then, one must judge from its cause whether such bodily defilement of necessity hinders the receiving of this sacrament.
At the same time a sense of decency forbids Communion on two accounts. The first of these is always verified, viz. the bodily defilement, with which, out of reverence for the sacrament, it is unbecoming to approach the altar (and hence those who wish to touch any sacred object, wash their hands): except perchance such uncleanness be perpetual or of long standing, such as leprosy or issue of blood, or anything else of the kind. The other reason is the mental distraction which follows after the aforesaid movements, especially when they take place with unclean imaginings. Now this obstacle, which arises from a sense of decency, can be set aside owing to any necessity, as Gregory says (Regist. xi): "As when perchance either a festival day calls for it, or necessity compels one to exercise the ministry because there is no other priest at hand."
Reply Obj. 1: A person is hindered necessarily, only by mortal sin, from receiving this sacrament: but from a sense of decency one may be hindered through other causes, as stated above.
Reply Obj. 2: Conjugal intercourse, if it be without sin, (for instance, if it be done for the sake of begetting offspring, or of paying the marriage debt), does not prevent the receiving of this sacrament for any other reason than do those movements in question which happen without sin, as stated above; namely, on account of the defilement to the body and distraction to the mind. On this account Jerome expresses himself in the following terms in his commentary on Matthew (Epist. xxviii, among St. Jerome's works): "If the loaves of Proposition might not be eaten by them who had known their wives carnally, how much less may this bread which has come down from heaven be defiled and touched by them who shortly before have been in conjugal embraces? It is not that we condemn marriages, but that at the time when we are going to eat the flesh of the Lamb, we ought not to indulge in carnal acts." But since this is to be understood in the sense of decency, and not of necessity, Gregory says that such a person "is to be left to his own judgment." "But if," as Gregory says (Regist. xi), "it be not desire of begetting offspring, but lust that prevails," then such a one should be forbidden to approach this sacrament.
Reply Obj. 3: As Gregory says in his Letter quoted above to Augustine, Bishop of the English, in the Old Testament some persons were termed polluted figuratively, which the people of the New Law understand spiritually. Hence such bodily uncleannesses, if perpetual or of long standing, do not hinder the receiving of this saving sacrament, as they prevented approaching those figurative sacraments; but if they pass speedily, like the uncleanness of the aforesaid movements, then from a sense of fittingness they hinder the receiving of this sacrament during the day on which it happens. Hence it is written (Deut. 23:10): "If there be among you any man, that is defiled in a dream by night, he shall go forth out of the camp; and he shall not return before he be washed with water in the evening."
Reply Obj. 4: Although the stain of guilt be taken away by contrition and confession nevertheless the bodily defilement is not taken away, nor the mental distraction which follows therefrom.