כִּֽי־יִמָּצֵ֨א אִ֜ישׁ שֹׁכֵ֣ב ׀ עִם־אִשָּׁ֣ה בְעֻֽלַת־בַּ֗עַל וּמֵ֙תוּ֙ גַּם־שְׁנֵיהֶ֔ם הָאִ֛ישׁ הַשֹּׁכֵ֥ב עִם־הָאִשָּׁ֖ה וְהָאִשָּׁ֑ה וּבִֽעַרְתָּ֥ הָרָ֖ע מִיִּשְׂרָאֵֽל׃ (ס)
Si un homme est surpris ayant commerce avec une femme mariée, ils mourront tous deux également, l’homme qui a eu commerce avec la femme, ainsi que cette dernière. Et tu feras disparaître ce mal en Israël.
Rashi
ומתו גם שניהם THEN THEY SHALL BOTH OF THEM DIE — The redundant words גם שניהם are intended to exclude a case of unnatural intercourse from which the woman derives no gratification (Sifrei Devarim 242:4; Sanhedrin 66b).
Chizkuni
ומתו גם שניהם, “they will both have to die;” Rashi explains the unusual wording, i.e. not “they will both be executed,” by saying that this includes the descendents of this pair of sinners. We are not to assume that as soon as these people have been convicted, even though not yet executed, any unborn children will not be affected by their deeds, since their parents had already been considered legally dead. What these people had done does not come under the heading of “if the parents sinned why should the children be punished for this? The word גם, “also,” in our verse is the Torah’s hint that this situation is different from other situations in which parents are both guilty of a serious sin violating the laws of chastity. An alternate approach to our verse: the word גם does indeed refer to the descendants of this pair of adulterers. Even if the willing female partner is a minor, she will also be subject to the penalty of having committed adultery. The same is true for an adult married woman who committed adultery with a boy that had not yet reached puberty. This is though even though we had been told in verse 21 that the girl involved who by being described as נערה was not yet an adult was alone in being stoned to death, (seeing she shamed her father under whose roof she had indulged in such shameless conduct). Furthermore, we cannot punish the person with whom she lost her virginity as we do not know who he was. If the adulterer (male) was known and there is evidence against both, they will both be subject to death by strangulation. Another interpretation of the apparently superfluous word גם: even if the woman involved in this adultery is pregnant at the time, we do not wait with carrying out the death sentence until her baby is born. According to an interpretation in Ibn Ezra, the word גם is a hint that more laws concerning forbidden sexual unions will follow.
Da'at Zekenim
ומתו גם שניהם, “and they are both to die as a result.” Rashi comments that the apparently extraneous word גם also, means that also the offspring of such a forbidden union is to die. He adds that if a man had cohabited with the woman in question after she had been condemned to die by the court that man is subject to the same penalty. The Torah had to add this as we might have thought that as soon as the woman had been convicted she was legally already considered as no longer alive.