As to the state of grace he says, What agreement has the temple of God with idols? As if to say: there is no agreement. Hence, you are a temple of God by grace: "Do you not know that you are God's temple and that God's Spirit dwells in you?" (1 Cor. 3:16). Therefore, you should not communicate with unbelievers, who are temples of idols. But it should be noted that in Ez. 25, the Lord forbids idols to be worshipped in God's temple. Much more then are men forbidden, whose souls are God's temple, to violate them by partaking of idols: "If any one destroys God's temple, God will destroy him" (1 Co...r. 3:17).
Then when he says, For you are the temple of the living God, he strengthens his reason with an authority. In regard to this he does two things. First, he confirms what he had concluded by reason of an admonition; secondly, he confirms the admonition itself (v. 17). In regard to the first he does two things. First, he reviews what he intends to prove; secondly, he quotes an authority to support his conclusion (v. 17c).
He says therefore: rightly do I say that there is no agreement between the temple of God and idols, i.e., you should not take part in them, because you are the temple of the living God, and not of a dead one, as idolaters are.
To prove this he cites an authority, proving this very point from the use to which a temple is put. For the use of a temple is that God dwell in it, because a temple is a place consecrated for God to dwell in: "The Lord is in his holy temple" (Ps. 11:4). This authority is taken from Lev. (26:11), which says: "And I will make my abode among you". In this authority four things are touched as pertaining to this use. The first pertains to operating grace, which consists in God's being is someone through grace; and this is what he says, I will live in them, namely, in the saints, adorning them with grace. For although God is said to be in all things by his presence, power, and essence, he is not said to dwell in them, but only in the saints through grace; the reason being that God is in all things by his activity, inasmuch as he joins himself to them as giving esse and conserving it, but in the saints by their very activity, by which they attain to God and in a way comprehend him, which is to love and to know. For those who know and those who love have within themselves the thing known and loved. The second pertains to cooperating grace, by which the saints make progress with God's help; as to this he says, I will move among them, i.e., I will promote them from virtue to virtue, for this progress is impossible without grace: "By the grace of God I am what I am" (1 Cor. 15:10). For just as operating grace makes us to be something in the being [esse] of justice, so cooperating grace makes us progress in that being [esse]. The third pertains to God's benefits: and this is either the benefit of his protection through providence; hence, he touches this when he says, and I will be their God, i.e., I will protect them by my providence: "Happy the people whose God is the Lord" (Ps. 144:15), or the benefit of recompense. As if to say: I will be their God, i.e., I will give them myself as a reward: "Your reward shall be very great" (Gen. 15:1); "Therefore God is not ashamed to be called their God" (Heb. 11:16). The fourth pertains to correct worship and service offered by the saints; as to this he says, and they shall be my people, i.e., they will worship me and obey me as mine and not another's: "We are the people of his pasture, the sheep of his hand" (Ps. 95:4).
Or they could refer to bodily presence; then it is explained this way: For I will live in them by assuming flesh: "The Word became flesh and dwelt among us" (Jn. 1:14), and I will move among them bodily by living with them: "Afterward she appeared upon earth and lived among men." (Bar. 3:37), and I will be their God by glory: "For what great nation is there that has a god so near to it as the LORD our God is to us" (Deut. 4:7). And they shall be my people, i.e., they will worship me in faith.
Source: Commentary on 2 Corinthians