Biblical References
The English word "bastard" in used three times in the King James Bible to denote children born out of wedlock or otherwise produced unlawfully. Two of these occurrences are found in the Old Testament while one is in the New.
A bastard (Hebrew mamzer, Strong's Concordance #H4464) shall not enter into the congregation of the Lord; even to his tenth generation shall he not enter into the congregation of the Lord (Deuteronomy 23:2, KJV).
And a bastard (mamzer) shall dwell in Ashdod, and I will cut off the pride of the Philistines (Zechariah 9:6, KJV).
But if ye be without chastisement, whereof all are partakers, then are ye bastards (Greek nothos, Strong's #G3541), and not sons (Hebrews 12:8, KJV).
Definitions
In the Old Testament, children were considered a bastard if their mother was a non-Israelite (heathen) regardless of whether their father was an Israelite or not. Easton's Bible Dictionary defines the Biblical term "bastard" as being synonymous with the word "polluted."

Even though the Lord told the children of Israel not to marry into the pagan nations that surrounded them they did so anyway. He called the offspring of such unapproved marriages bastards or illegitimate. It took several generations before the descendants of such marriages were allowed back into the Lord's congregation (which is another name for the nation of Israel).
In Zechariah 9:6 the Hebrew mamzer is again used. In this context it could mean someone born outside of marriage or produced through a forbidden marriage or in adultery (Barnes Notes on the Bible). It could also mean someone foreign born (Easton's Illustrated Dictionary).
The Apostle Paul's use of nothos in Hebrews 12:8 is used to describe those who do not receive correction from the Lord. Such people, who do not share in the same discipline as is meted out toward others considered legitimate, also do not share in the same privileges as those who are converted.
No Respecter of Persons
Our Creator in heaven is, without a doubt, no respecter of persons. The apostle Peter, a Jew, was speaking to a group of gentiles when he said that God does not respect one person over another but rather accepts anyone who is willing to listen to Him and do his will (Acts 10:34 - 35).
Children, of course, have no choice as to who their parents are and neither does an illegitimate (born without the benefit of their parents being married) person. The apostle Peter, however, reminds us that if anyone, regardless of how they came into the world, fears God and does what is right, that they will be accepted.
Conclusion
The nature of a person's birth has nothing whatsoever to do with whether or not they are ultimately saved. Salvation is not based on whether a born out of wedlock (illegitimate) or not. What really makes a difference is whether a person has a close and intimate relationship with our Father in heaven.