We could take this reference literally as a reference to the seventh commandment prohibiting adultery. In that case the Lord would be describing the redeemed as persons who are faithful to their spouse (and not into divorce, pornography, homosexual activity, etc.). The phrase could also be understood to be a reference to the first commandment, where serving other gods (idolatry) is in fact spiritual adultery. The latter is the better understanding of the phrase, because 1) the Old Testament repeatedly refers to idolatry as spiritual adultery (e.g., Hosea 1:1 – 3:5; Jeremiah 3:6ff; Ezekiel 16:1–63); 2) John had been speaking about the church as the object of the dragon’s attacks (Revelation 12:17). That her “offspring” remain faithful to God (instead of committing spiritual adultery in response to the dragon’s/beasts’ temptations) is precisely because the Lamb preserves his own. Despite the attacks and temptations, these saints learn the song that celebrates the Lamb standing on Mount Zion.
4 It is these who have not defiled themselves with women, for they are virgins. It is these who follow the Lamb wherever he goes. These have been redeemed from mankind as firstfruits for God and the Lamb,