(…) Matthew doesn’t stick with kings, patriarchs, and other “respectable” figures. In a culture obsessed with national purity, he doesn’t stick with Israelites. And in a culture that pushed females to the sidelines, he doesn’t even stick with males.
Abraham became the father of Isaac. Isaac became the father of Jacob. Jacob became the father of Judah and his brothers. Judah became the father of Perez and Zerah by Tamar. Perez became the father of Hezron. Hezron became the father of Ram. (Matthew 1:2–3, WEB)
Just a few generations in, Matthew points out the fact that “Judah became the father of Perez and Zerah by Tamar.” He could have easily skipped the bit about Tamar, and the genealogy would have continued just fine, but he wanted to be sure his readers remembered this detail. Tamar was Judah’s daughter in law, but she dressed herself as a prostitute, seduced her father in law, and conceived Perez and Zerah by this incestuous relationship (Genesis 38).
Ram became the father of Amminadab. Amminadab became the father of Nahshon. Nahshon became the father of Salmon. Salmon became the father of Boaz by Rahab. Boaz became the father of Obed by Ruth. Obed became the father of Jesse. (Matthew 1:4–5, WEB)
Matthew here points out two more women who could have easily been left out. Rahab was a prostitute and a Canaanite. Ruth was no prostitute, but as Bruner points out, she was “a Moabite, a descendant of the incestuous Lot (Gen 19), and thus low on the social and spiritual register of some of the racially protective people of God.”
Jesse became the father of King David. David became the father of Solomon by her who had been Uriah’s wife. (Matthew 1:6, WEB)
Here Matthew points out another woman, yet this time he does so indirectly, and this too is intentional. Rather than calling her by name, Matthew refers to Bathsheba as “her who had been Uriah’s wife”—in order to highlight David’s sin. David spied on Bathsheba while she was bathing, he ordered for her to be brought to him, he impregnated her (and given the fact that she had no right to refuse the king, I’m very inclined to call this rape), and he ultimately orchestrated the murder of her husband in an attempt to cover up his sin (2 Samuel 11).
Note that all these anomalous inclusions in the genealogy either led up to or were involved with David, the great hero of Israel. Matthew is showing his purity-obsessed Jewish audience that God can and will work through anyone. He does not prefer the morally upright, those with Jewish blood, nor even males. (…)’
source: Chuck McKnight (hippieheretic).