This is an explanation from Charles Hodge that I think is pretty helpful:
1 Corinthians 7:14 For the unbelieving husband is sanctified by the wife, and the unbelieving wife is sanctified by the husband: else were your children unclean; but now are they holy.
“The proof that such marriages may properly be continued, is, that the unbelieving party is sanctified by the believing; and the proof that such is the fact, is, that by common consent their children are holy; which could not be, unless the marriages whence they sprang were holy; or unless the principle that intimate communion with the holy renders holy, were a correct principle.
The assertion of the apostle is, that the unbelieving husband or wife is sanctified in virtue of the marriage relation with a believer. We have already seen that the word (agiazein), to sanctify, means, 1. To cleanse. 2. To render morally pure. 3. To consecrate, to regard as sacred, and hence, to reverence or to hallow. Examples of the use of the word in the third general sense just mention, are to be found in all parts of Scripture. Any person or thing consecrated to God, or employed in his service, is said to be sanctified. Thus, particular days appropriated to his service, the temple, its utensils, the sacrifices, the priest, the whole theocratical people, are called holy. Persons or things not thus consecrated are called profane, common, or unclean. To transfer any person or thing from this latter class to the former, is to sanctify him or it. What God hath cleansed (or sanctified), that call not thou common,” Acts 10:15. Every creature of God is good, and is to be received with thanksgiving, “For it is sanctified by the word of God and prayer,” 1 Tim. 4:5. This use of the word is specifically frequent in application to persons and communities. The Hebrew people were sanctified (i.e. consecrated), by being selected from other nations and devoted to the service of the true God. They were, therefore constantly called holy. All who joined them, or who were intimately connected with them, became in the same sense, holy. Their children were holy; so were their wives. “If the first-fruits be holy, the lump is also holy; and if the root be holy, so are also the branches,” Rom. 11:26. That is, if the parents be holy, so are also the children. Any child, the circumstances of whose birth secured it a place within the pale of the theocracy, or commonwealth of Israel, was according to the constant usage of Scripture, said to be holy. In none of these cases does the word express any subjective or inward change. A lamb consecrated as a sacrifice, and therefore holy, did not differ in its nature from any other lamb. The priests or people, holy in the sense of set apart to the service of god, were in their inward state the same as other men. Children born within the theocracy, and therefore holy, were nonetheless conceived in sin, and brought forth in iniquity. They were by nature the children of wrath, even as others, Eph. 2:3. When therefore, it is said that the unbelieving husband is sanctified by the believing wife, and the unbelieving wife by the believing husband, the meaning is not that they are rendered inwardly holy, nor that they are brought under a sanctifying influence, but that they were sanctified by their intimate union with a believer, just as the temple sanctified the gold connect with it; or the altar the gift laid upon it, Matt. 23:17, 19. The sacrifice in itself was merely a part of the body of a lamb, laid upon the altar, though it’s internal nature remained the same, it became something sacred. Thus the pagan husband in virtue of his union with a Christian wife, although he remained a pagan, was sanctified; he assumed a new relation; he was set apart to the service of God, as the guardian of one of his chosen ones, and as the parent of children who, in virtue of their believing mother were children of the covenant.
That this is so, the apostle proves from the fact, that if the parents are holy, the children are holy; if the parents are unclean, the children are unclean. This is saying literally what is expressed figuratively in Rom. 11:16. “If the root be holy, so are the branches.” It will be remembered that the words holy and unclean, do not in this connection express moral character, but are equivalent to sacred and profane. Those within the covenant are sacred, those without are profane, i.e. not consecrated to God. There are two views which may be taken of the apostle’s argument in this verse. The most natural, and hence the most generally adopted view is this: ‘The children of these mixed marriages are universally recognized as holy, that is, as belong to the church. If this be correct, which no one disputes, the marriages themselves must be consistent with the laws of God. The unbelieving must be sanctified by the believing partner. Other wise, you children would be unclean, i.e. born out of the pale of the church. To this it is indeed object by several modern commentators, that it takes for granted that the Corinthians had no scruples about the church-standing of the children of these mixed marriages. But this it is said, is very improbable so soon after the establishment of the church, when cases of the kind must have been comparatively few. The principle in question, however, was not a new one, to be then first determined by Christian usage. It was, at least, as old as the Jewish economy; and familiar wherever Jewish laws and the facts of the Jewish history, were known. Paul circumcised Timothy, whose father was a Greek while his mother was a Jewess, because he knew that his countrymen regarded circumcision in such cases as obligatory, Acts 16:1-3. The apostle constantly assumes that his readers were familiar with the principles and facts of the Old Testament economy. Comp. 10:1-13.
The other view of the argument is this: ‘If, as you admit, the children of believers be holy, why should not the husband or the wife of a believer be holy. The conjugal relation is as intimate as the parental. If the one relation secures this sacredness, so must the other. If the husband be not sanctified by his believing wife, children are not sanctified by believing parents.’ This, however, supposes a change in the persons addressed. Paul is speaking to persons involved in these mixed marriages. Your children naturally mean the children of you who have unbelieving husbands or wives. Whereas this explanation supposed your to refer to Christians generally. In either way, however, this passage recognizes as universally conceded the great scriptural principle, that the children of believers are holy. They are holy in the same sense in which the Jews were holy. They are included in the church, and have a right to be so regarded. The child of a Jewish parent had a right to circumcision, and to all the privileges of the theocracy. So the child of a Christian parent has a right to baptism and to all the privileges of the church, so long as he is represented by his parent; that is, until he arrives at the period of life when he is entitled and bound to act for himself. Then his relation to the church depends upon his own act. The church is the same in all ages. And it is most instructive to observe how the writers of the New Testament quietly take for granted that the great principles which underlie the old dispensation, are still in force, under the new. The children of Jews were treated as Jews; and the children of Christians, Paul assumes as a thing no one would dispute, are to be treated as Christians. Some modern German writers find in this passage a proof that infant baptism was unknown in the apostolic church. They say that Paul could not attribute the holiness of children to their parentage, if they were baptized – because their consecration would then be due to that rite, and not to their descent. This is strange reasoning. The truth is, that they were baptized not to make them holy, but because they were holy. The Jewish child was circumcised because he was a Jew, and not to make him one. The Rabbins say: Peregrina si proselyte fuerit et cum ea ejus – si concepta fuerit et nata in sanctitate, est ut filia Israelite per omnia. See WETSTEIN in loc. To be born in holiness (i.e. within the church) was necessary in order to the child being regarded as an Israelite. So Christian children are not made holy by baptism, but they are baptized because they are holy.”