Someone asked this question on Quora in this way:
The older codes of Indian law define the following six categories of children (sons) and their legal inheritance rights, excluding adoptions:
1. Born of a woman through her wedded husband, called the son of the body (ourasa)
2. Born of a woman by her second marriage, called the son of a remarried woman (punarbhava)
3. Born in accordance with the law of Niyoga(*), called a son begotten on a wife (kshetrajna)
4. Born of a married woman by an affair (not niyoga) called a son born secretly in home (gudhotpanna or grihaja)
5. Born of a damsel in the house of her father, called the son of an unmarried woman (kanina or jaraja)
6. Born of a woman already pregnant at the time of marriage, called a son received with the bride (sahodha)
*Niyoga: When the husband is dead, impotent, diseased, or missing, the relatives of the wife’s or husband’s family, or sometimes the husband himself would designate someone else to make the wife pregnant. Typically this would be a sibling of the husband, a cousin or someone respected and eminent.
No one can deny that with the possible exception of Niyoga (at least as a formal custom), all other situations still exist. So how, why and when did we get so prudish as to ignore all the categories after the first two – and the second again only very recently?
Here is one answer that seems to gell with my view of it as well:
Read Quote of Kaustubh Pratap’s answer to History of India: Why and when exactly did Indians get so prudish? on Quora