To keep His people, the physical nation of Israel, pure and strong, God forbade an illegitimate child from holding a public office. This may have included other reasons, but generally referred to offspring from any of the prohibited marriages mentioned in Leviticus 18 and 20.
We should keep in mind that Old Testament Israel was an unconverted, carnal people whose interests were purely physical. Today, however, God is building a spiritual Family (I Pet. 2:5, 9) rather than a physical one. Every individual will have a chance to become a part of this Family depending on how he lives his own life. A child will not be denied eternal life due to his parent’s sins, nor will a parent lose out on salvation because of his child’s sins. A person’s relationship with God is entirely dependent on his or her own actions. (You may wish to read Jeremiah 31:29-30 and Philippians 2:12.)
Christ commands Christians to worship God in spirit and in truth (John 4:23-24). Therefore, a person’s physical ancestry will not prevent him from being called into God’s Family. In the Old Testament, God had chosen one nation to work with. Today, we know that people of all nationalities and cultural backgrounds may enter His Family, upon real repentance and baptism. Please read Acts 17:30, Galatians 3:28-29 and II Peter 3:9.