Four women appear in Matthew’s genealogy, all of them connected with some scandal - Tamar, who fathered twins by her father-in-law, Judah; Rahab, retired prostitute; Ruth, a forward Moabitess; and Bath-sheba, whom David seized from Uriah. Though unnamed, three of the same women are implied in the genealogy that ends the book of Ruth - Perez, son of Tamar; Boaz, son of Rahab; Obed, son of Ruth.
Though most of the women are involved in scandal, the scandal is less the fault of the women than the men. Judah acknowledges that Tamar is more righteous than he is, since he failed to fulfill his obligations to provide a husband to her. Rahab sides with Israel against her own city. Bath-sheba is a victim of David’s lust and greed. Ruth seems sexually aggressive only because we haven’t quiet shed our Victorian prudery. To Boaz, her actions are nothing but commendable.
Each of these is a scandal within the tribe of Judah. That’s obvious, since Ruth’s genealogy is the genealogy of David and Matthew’s is the genealogy of the greater David Jesus. But it’s significant. All the “scandalous” unions in the Bible involve kings or the ancestors and descendants of kings.
These “marriages” differ among themselves, but they form a pattern of royal behavior. This is what kings do: They bring outcast women into their home. This is what King Jesus does: He seeks a wayward bride to make her a joyful mother of children.