Does God hate people born outside of their parents' marriage?
There has been confusion due to a passage in the Old Law: "No one of illegitimate birth shall enter the assembly of the LORD; none of his descendants, even to the tenth generation, shall enter the assembly of the LORD" (Deuteronomy 23:2). We tend to read "illegitimate" from our modern view that a child born out of wedlock is illegal. However, from the Law of Moses an illegal union was with any of the seven nations the Israelites were not allowed to marry.
"When the LORD your God brings you into the land which you go to possess, and has cast out many nations before you, the Hittites and the Girgashites and the Amorites and the Canaanites and the Perizzites and the Hivites and the Jebusites, seven nations greater and mightier than you, and when the LORD your God delivers them over to you, you shall conquer them and utterly destroy them. You shall make no covenant with them nor show mercy to them. Nor shall you make marriages with them. You shall not give your daughter to their son, nor take their daughter for your son. For they will turn your sons away from following Me, to serve other gods; so the anger of the LORD will be aroused against you and destroy you suddenly" (Deuteronomy 7:1-4).
"Or else, if indeed you do go back, and cling to the remnant of these nations - these that remain among you-and make marriages with them, and go in to them and they to you, know for certain that the LORD your God will no longer drive out these nations from before you. But they shall be snares and traps to you, and scourges on your sides and thorns in your eyes, until you perish from this good land which the LORD your God has given you" (Joshua 23:12-13)
The reason for the restriction was simple: these were nations who were being driven out of the land of Canaan because of their idolatrous practices (Leviticus 18:24-30). God did not want the Israelites to pick up their practices. Thus these nations were utterly destroyed within the borders of Israel to prevent the corruption of true worship (Deuteronomy 20:17-18).
If someone violated these laws, the children of such mixed parentage were excluded from ever becoming Israelites, along with descendants of certain nations. "One of illegitimate birth shall not enter the assembly of the LORD; even to the tenth generation none of his descendants shall enter the assembly of the LORD. An Ammonite or Moabite shall not enter the assembly of the LORD; even to the tenth generation none of his descendants shall enter the assembly of the LORD forever, because they did not meet you with bread and water on the road when you came out of Egypt, and because they hired against you Balaam the son of Beor from Pethor of Mesopotamia, to curse you" (Deuteronomy 23:2-4). "Illegitimate" here means children of an illegal or forbidden union. The wording is broad enough to include children born to married and unmarried parents where at least one of them were members of the forbidden nations.
It is this sin was what lead to Solomon's downfall (I Kings 11:1-4). And in the days of Ezra and Nehemiah, the Israelites repeated the same sins. To counter it, the people who returned from captivity made a vow which included a term not to intermarry (Ezra 10:1-5; Nehemiah 10:28-31). However, it was a vow that they did not keep.
"In those days I also saw Jews who had married women of Ashdod, Ammon, and Moab. And half of their children spoke the language of Ashdod, and could not speak the language of Judah, but spoke according to the language of one or the other people. So I contended with them and cursed them, struck some of them and pulled out their hair, and made them swear by God, saying, "You shall not give your daughters as wives to their sons, nor take their daughters for your sons or yourselves. Did not Solomon king of Israel sin by these things? Yet among many nations there was no king like him, who was beloved of his God; and God made him king over all Israel. Nevertheless pagan women caused even him to sin. Should we then hear of your doing all this great evil, transgressing against our God by marrying pagan women?" And one of the sons of Joiada, the son of Eliashib the high priest, was a son-in-law of Sanballat the Horonite; therefore I drove him from me. Remember them, O my God, because they have defiled the priesthood and the covenant of the priesthood and the Levites" (Nehemiah 13:23-29).
Notice that the Philistines, Moabites, and Ammonites were particularly mentioned. These were among the nations the Israelites were forbidden to marry. Worse, members of the priesthood and other leading Jews were foremost in violating this law (Ezra 9:1-4). Priest were particularly forbidden to marry women from other nations (Leviticus 21:14-15). And the people knew they were sinning. "On that day they read from the Book of Moses in the hearing of the people, and in it was found written that no Ammonite or Moabite should ever come into the assembly of God, because they had not met the children of Israel with bread and water, but hired Balaam against them to curse them. However, our God turned the curse into a blessing. So it was, when they had heard the Law, that they separated all the mixed multitude from Israel" (Nehemiah 13:1-3). Their violation was no accident.
Because they had broken their oath, Nehemiah forced the people to renew their vows. The end of the book of Ezra lists out the people who refused to put away their foreign wives and children. Their families were marked for life.
The impact of Nehemiah and Ezra on Israel lasted for centuries (John 4:9). But as people typically do, they went overboard. "Then he said to them, "You know how unlawful it is for a Jewish man to keep company with or go to one of another nation. But God has shown me that I should not call any man common or unclean" (Acts 10:28). Doing what God said wasn't enough. They went beyond by isolating themselves from people of all other nations and not just those God had told them to avoid.
Included in the category of illegitimate were the forbidden unions between people too closely related, as listed in Leviticus 18:6-25. Though whether this was God's intention is not clearly evident. Perez, one of the sons of Judah was born of the union between his father and his daughter-in-law; yet, he and his decendents were considered Israelites.
The Jews were a cautious lot, and this law excluding children whose parents were from one of the seven forbidden nations was extended to children whose paternity was unknown. Thus, a found child, the child of a prostitute, or a child whose father was unknown because the mother refused to say was treated as illegitimate because there was the possibilty that the father might have been from one of the seven forbidden nations. There is indications that this was another overreach by the Jews.
This fear of illegitimacy was picked up by Christians in Corinth, who apparently thought that a Christian marrying a non-Christian was an illegitimate marriage. Paul argued that it could not be, else there children would not be able to be saved. "For the unbelieving husband is sanctified by the wife, and the unbelieving wife is sanctified by the husband; otherwise your children would be unclean, but now they are holy" (I Corinthians 7:14).
God has never held the actions of parents against their children. "The soul who sins shall die. The son shall not bear the guilt of the father, nor the father bear the guilt of the son. The righteousness of the righteous shall be upon himself, and the wickedness of the wicked shall be upon himself" (Ezekiel 18:20). Even when children were present, they were not responsible for the wrong decisions made by their parents. While the adults were not allowed to enter the land of Canaan, their children were allowed. "Moreover your little ones and your children, who you say will be victims, who today have no knowledge of good and evil, they shall go in there; to them I will give it, and they shall possess it" (Deuteronomy 1:39).
There were children born out of wedlock who were servants of God. The famous judge, Jephthah was the son of a prostitute. "Now Jephthah the Gileadite was a mighty man of valor, but he was the son of a harlot; and Gilead begot Jephthah" (Judges 11:1). While God did not hold it against him and selected him to lead Israel, it is clear from the story that his fellow Israelites did hold it against him wrongly.