From another forum:
Just look at the words legitimate and illegitimate! These are legal terms. An illegitimate child, originally, was one which was not recognised in law. Illegitimacy quite specifically barred children from inheriting estates or offices. William I of England was illegitimate but gained the throne through conquest.