And Jesse begat David the king; and David the king begat Solomon of her that had been the wife of Uriah;
Read Chapter 1
Ambrose of Milan
But the holy David is the more excellent in this, that he confessed himself tobe but man, and neglected not to wash out with the tears of repentance the sin of which he had been guilty, in so taking away Urias’ wife. Herein shewing us that none ought to trust in his own strength, for we have a mighty adversary whom we cannot overcome without God’s aid. And you will commonly observe very heavy sins befalling to the share of illustrious men, that they may not from their other excellent virtues be thought more than men, but that you may see that asmen they yield to temptation.
De Cons. Evan., ii, 4: Since in Matthew’s genealogy is showed forth the taking on Him by Christ of our sins, therefore he descends from David to Solomon, in whose mother David had sinned. Luke ascends to David through Nathan, for through Nathan the prophet of God punished David’s sin; because Luke's genealogy is to show the putting away of our sins.
Solomon is interpreted, ‘peace-maker,’ because having subdued all the nations round about, and made them tributary, he had a peaceful reign. Roboam in interpreted, ‘by a multitude of people,’ for multitude is the mother of sedition; for where many are joined in a crime, that is commonly unpunishable. But a limit in numbers is the mistress of good order.
Let us enquire why Matthew does not mention Bathsheba by name as he does the other women. Because the others, though deserving of much blame, were yet commendable for many virtues. But Bathsheba was not only consenting in the adultery, but in the murder of her husband, hence her name is not introduced in the Lord’s genealogy.
The Evangelist exposes and derides the passions of our race, its dishonors and ailments, to which the Word of God descended in his mercy. He descended to glorify them and raise them up by his charity. It in no way reflects badly upon the physician that he stoops to the level of those who are sick. Matthew could have written, “David became the father of Solomon by Bathsheba” (the name of the woman involved). In deriding, so to speak, adultery itself, he rather stated clearly, “And David was the father of Solomon by the wife of Uriah.” He thus showed that Christ, who descended from such a degenerate race by generation, “took up our infirmities and bore the burden of our ills,” as one of the prophets said. Cathedral Sermons, Homily
Again, he mentions Uriah’s wife to show that no one should be ashamed of his forefathers but rather should strive by his own virtue to make even them illustrious. He also mentions Uriah’s wife to show that all are acceptable to God, even those born of adultery, if only they have virtue.