We begin Chapter 23 with a section titled "Exclusion From The Assembly" and many scholars believe those Israelites who are said to be excluded from the assembly are not forbidden to take part in the general religious life of Israel but that they are forbidden to hold religious office in Israel. In the case of non-Israelites mentioned in our passage, I doubt they were ever allowed to hold religious office at all, but after a specified period of time they could take part in religious activities with the congregation.
"No one who has been emasculated by crushing or cutting may enter the assembly of the Lord." (Deuteronomy 23:1) This was mentioned in the book of Leviticus when the Lord provided Aaron the high priest with a list of defects that would disqualify some of his descendants from being priests. "For the generations to come none of your descendants who has a defect may come near to offer the food of his God. No man who has any defect may come near: no man who is blind or lame, disfigured or deformed; no man with a crippled foot or hand, or who is a hunchback or a dwarf, or who has any eye defect, or who has festering or running sores or damaged testicles." (Leviticus 21:17-20) The man could still worship the Lord and partake of the offerings but he could not hold the office of high priest. (Leviticus 21:22) Although Deuteronomy 23:1 sounds as if the man can't enter the assembly at all, in my background study it appears to be the general consensus that he can be a part of the congregation; he just can't be part of the leadership council.
Barring men with serious physical defects from holding office may symbolize the need for anyone holding office to not have serious spiritual defects. Or it could be that having priests and servers in the house of the Lord with visibly obvious physical problems was distracting to the congregation and took their focus away from worship. We discussed the possible reasons for these restrictions when we studied the book of Leviticus. Today we'll only look at the reason why men who are eunuchs are not allowed to hold office in Israel.
The main reason for this is likely linked to idolatry. Some of the heathen priests were castrated, either by choice or because it had been done to them in their youth when they were given the job of being "altar boys". In a lot of cases these eunuchs were used in the same manner as female temple prostitutes. Pagan kings would appoint eunuchs to guard their harems because they did not trust men who were sexually whole to refrain from having relations with the women. It was also a custom of heathen cultures to castrate young men they took captive after conquering their people in battle. It has been speculated that the males the Babylonians took captive from Jerusalem were made into eunuchs (Daniel, Shadrach, Meshach, Abednego, and others like them). The Bible doesn't specifically say these young men were castrated but I believe many of those taken captive were, for Isaiah foretold it when speaking to King Hezekiah in 2 Kings 20:18, saying: "And some of your descendants, your own flesh and blood who will be born to you, will be taken away, and they will become eunuchs in the palace of the king of Babylon."
Another reason for exclusion from religious office is probably because a eunuch could not father children. He was not considered "whole" in the sense that he could continue his family line. A man with a defect this severe could not be a high priest of Israel because the office of high priest was handed down from one generation to the next. There would be no next generation for a man who was a eunuch. If the man's father was high priest, the father would have to appoint a different son to succeed him, not the son who had been born without normal testicles or who had suffered an emasculating injury.
We move on to the next category. "No one born of a forbidden marriage nor any of their descendants may enter the assembly of the Lord, not even in the tenth generation." (Deuteronomy 23:2) In the original language the word translated into English as "forbidden marriage" is actually something like "mongrel" or "illegitimate". A child born out of wedlock could not grow up to hold religious office. Neither could a child born as the result of incest or adultery or a child born from a marriage between an Israelite and a non-Israelite.
"No Ammonite or Moabite or any of their descendants may enter the assembly of the Lord, not even in the tenth generation. For they did not come to meet you with bread and water on your way when you came out of Egypt, and they hired Balaam son of Beor from Pethor in Aram Naharaim to pronounce a curse on you. However, the Lord your God would not listen to Balaam but turned the curse into a blessing for you, because the Lord your God loves you. Do not seek a treaty of friendship with them as long as you live." (Deuteronomy 23:3-6) The descendants of Ammon and Moab, the sons Lot fathered with his own daughters, treated the Israelites cruelly. They were related to the Israelites by blood (Lot being the nephew of Abraham) but the Ammonites and Moabites wanted the Israelites wiped from the earth. In addition, these two tribes were idolatrous. They had forsaken the Lord and mixing with them was sure to bring idolatry into Israel.
Although the Edomites hadn't been very kind to the Israelites either, the Lord warns the Israelites not to hate them. "Do not despise an Edomite, for the Edomites are related to you." (Deuteronomy 23:7a) Edom was founded by Esau, the brother of Jacob, and the Israelites are therefore more closely related to the Edomites than they are to the descendants of Lot.
The Israelites aren't to hate anyone for being an Egyptian either. "Do not despise an Egyptian, because you resided as foreigners in their country. The third generation of children born to them may enter the assembly of the Lord." (Deuteronomy 23:7b-8) Egypt was part of the Lord's plan. He allowed Joseph's brothers to sell him into slavery so He could raise Joseph to the position of second-in-command to Pharaoh. He did this so, when the famine came, Joseph would be in a position to bring all his family to Egypt and save them from starvation. For a long time the Israelites enjoyed the prosperity of Egypt until a king (or an entire dynasty) was prejudiced toward them and wrongly regarded them as a threat. This isn't to be held against an Egyptian who wants to convert to the God of Israel. Egyptians could "join the church", so to speak, after three generations had passed from the time of the exodus. This third generation rule also appears to apply to the Edomites since they are mentioned in the same verse with the Egyptians.
This concludes our section of Chapter 23.