Of great concern to the Torah is keeping up the honor and purity of the Jewish home. Thus, in two places, the Torah lists forbidden sexual relationships (see Vayikra, Chapter 18 and Chapter 20:10-24), most of which are incestuous relationships. For these relationships, the punishment will be either karet (being “cut off” from the community, i.e. a symbolic death sentence) or mitat beit din (a capital offense). The people on this list (e.g. a parent and a child, siblings, etc.) cannot marry one another, and offspring born to such relationships are considered to be mamzerim (literally “bastards,” in the Gemara and halakhic literature this refers to children who are born from such forbidden relationships and cannot marry within the Jewish community – see Devarim 23:3). This is the opinion of Shimon haTeimani in a Mishna in Massekhet Yevamot (49a), which is accepted as the halakha.
Our Gemara presents the rejected position of Rabbi Akiva, who disagrees with Shimon ha-Temani and rules that any sexual relationship that is forbidden by the Torah – even a simple prohibition that will not carry with it the punishment of karet or mitat beit din – will preclude the possibility of marriage (i.e. not only is marriage forbidden, but if it is attempted it will have no meaning or significance – like a brother who tries to marry his sister – and there will be no need to end the marriage with a divorce) and children born from such a relationship would be mamzerim.
There are exceptions to these rules as interpreted by Shimon ha-Teimani and Rabbi Akiva. One of the forbidden sexual relationships that appears in the lists in Vayikra is sleeping with a nidda. In the Gemara in Yevamot we find that Abayye teaches that all agree that the child of such a relationship would not be a mamzer; his proof is the fact that marriage is possible when a woman is a nidda. The rishonim point out that it is obvious that nidda is different than all of the other cases of forbidden relationships, since in the course of every marriage the woman becomes a nidda without it affecting the couple’s marital status.