TheWholeTorah.aiBeta

Chapter 11 - David and Bat Sheva - Part 2

Chavrusa Learning
Listen0:00 / 0:00

Introduction: A parashah of depth within depth

This chapter is among the hardest and most daring in all of Tanach: the episode of David and Bat Sheva. The superficial reader sees here a simple story of a king who stumbled, but when we examine the pesukim according to the approach of the Malbim, and add to them the words of Chazal in the Gemara, the words of the holy Zohar, the explanation of Rav Dessler, and the secrets of the Arizal in Sefer HaGilgulim, an entirely different picture emerges. We will proceed in the order of the pesukim, and see how every detail here is laden with deep meaning.

"A person should never bring himself to a test" - the Gemara in Sanhedrin

To understand the root of the matter, let us begin with the Gemara in Massechet Sanhedrin, daf 107a. Rav Yehuda said in the name of Rav: A person should never bring himself to a test, for David king of Israel brought himself to a test and stumbled. David said before the Holy One, blessed be He: Master of the Universe, why do people say "God of Avraham, God of Yitzchak, and God of Yaakov," but they do not say "God of David"? Why is my name not mentioned as well in prayer? The Holy One, blessed be He, said to him: They passed a test before Me, and you have not passed a test before Me. He said before Him: Master of the Universe, examine me and test me, as it says "Examine me, Hashem, and test me." The Holy One, blessed be He, said to him: I will test you, and I will even do with you something I did not do with the holy Avot. To them I did not make known in what their test would be, and a test that comes as a surprise is far harder, whereas to you I make known in advance that your test will be in a matter of forbidden relations.

וַיְהִי לְעֵת הָעֶרֶב וַיָּקָם דָּוִד מֵעַל מִשְׁכָּבוֹ וַיִּתְהַלֵּךְ עַל־גַּג בֵּית־הַמֶּלֶךְ וַיַּרְא אִשָּׁה רֹחֶצֶת מֵעַל הַגָּג וְהָאִשָּׁה טוֹבַת מַרְאֶה מְאֹד׃ - And it was at evening time, and David arose from his bed and walked about upon the roof of the king's house, and he saw a woman bathing from the roof, and the woman was very beautiful to look upon.

"And David arose from his bed" - Rav Yehuda said: that he turned his bed of night into a bed of day. Since David knew that the Holy One, blessed be He, was about to test him in a matter of forbidden relations, he said: I will satisfy my desire in a permitted way, so that I will not come to a prohibition and will not think about another woman. But a halachah escaped him: there is a small limb in a person, if one satisfies it, it is hungry, and if one starves it, it is satisfied. He overlooked the principle that the more a person fulfills his craving, the more the desire intensifies, and conversely, when a person restrains his desire, the desire weakens.

And the Gemara continues: Bat Sheva was washing her hair modestly behind a beehive, something like a woven screen of reeds. The Satan came and appeared to David as a bird standing there beside the beehive. David shot an arrow at it in order to strike the dove, and the arrow split the beehive, and thereby Bat Sheva was revealed before him.

וַיִּשְׁלַח דָּוִד וַיִּדְרֹשׁ לָאִשָּׁה וַיֹּאמֶר הֲלוֹא־זֹאת בַּת־שֶׁבַע בַּת־אֱלִיעָם אֵשֶׁת אוּרִיָּה הַחִתִּי׃ - And David sent and inquired about the woman, and he said: Is this not Bat Sheva, daughter of Eliam, wife of Uriah the Hittite?
וַיִּשְׁלַח דָּוִד מַלְאָכִים וַיִּקָּחֶהָ וַתָּבוֹא אֵלָיו וַיִּשְׁכַּב עִמָּהּ וְהִיא מִתְקַדֶּשֶׁת מִטֻּמְאָתָהּ וַתָּשָׁב אֶל־בֵּיתָהּ׃ - And David sent messengers and took her, and she came to him, and he lay with her, and she had sanctified herself from her impurity, and she returned to her house.

About this David said: "You have examined my heart, You have visited it at night, You have refined me and found nothing; I resolved that my mouth would not transgress." What does "I resolved that my mouth would not transgress" mean? Would that a muzzle had fallen upon my mouth, and I had not said "Examine me, Hashem, and test me." Behold I stumbled: I said examine me and test me, and in the end the Holy One, blessed be He, tested me, and I did not withstand the test.

Rava expounded: What is the meaning of the verse "To the conductor, of David: In Hashem I have taken refuge; how can you say to my soul, flee to your mountain like a bird"? David said before the Holy One, blessed be He: Master of the Universe, forgive me for that sin, so that they will not say that a mountain among you was chased away by a bird. Who moved the mountain among you? Who could prevail over him? A small bird managed to bring him down.

Rava expounded: What is the meaning of the verse "Against You, You alone, have I sinned, and done what is evil in Your eyes, so that You are justified when You speak and vindicated when You judge"? David said before the Holy One, blessed be He: Master of the Universe, it is revealed and known before You that had I wished to subdue my inclination I could have subdued it, but I said that they should not say that the servant defeated his master. This is an astounding wonder: David says that he could have overcome his inclination, yet he did not overcome it, so that they would not say the servant defeated his master. The Master said "I will test you," and the servant said "Test me and you will see that I will withstand it." How can it be that a person would transgress on account of this? We will address this further on.

Rava expounded: what is the meaning of the verse "For I am ready to stumble, and my pain is ever before me"? Bat Sheva daughter of Eliam was fit for David from the six days of Creation, only that she came to him with pain. And so it was taught in the school of Rabbi Yishmael: Bat Sheva daughter of Eliam was fit for David, only that he ate her unripe - he ate her before she ripened. That is, David hurried and took something that was coming to him, but its time had not yet arrived, and this was his sin. And what does "from the six days of Creation" mean? For usually a person's match is set forty days before the formation of the child, not from the six days of Creation. This we will explain later on.

Rava expounded: what is the meaning of the verse "But when I stumbled they rejoiced and gathered together, the wretched gathered against me and I knew it not, they tore and did not cease"? David said before the Holy One blessed be He: Master of the Universe, it is revealed and known before You that if they were to tear my flesh my blood would not flow. Those people who studied Torah with him, Doeg and Achitofel, would shame him until the redness left his face - the red departed and the pale came - until his face turned white, and were they to cut him no blood would come out of him. And not only that, but when they engaged in the four death penalties of the court, they would pause from their study and say to him, seemingly in innocence: David, one who has relations with a married woman, by what death does he die? That is, you make yourself out to be righteous, yet you carry the sin of a married woman. And he would answer them: one who has relations with a married woman, his death is by strangulation, and he has a share in the World to Come; but one who publicly shames his fellow has no share in the World to Come.

The explanation of Rav Dessler: the fine sin that dragged along the great sin

Our Sages say: David was not fit for that deed, but he did so in order to teach the way of repentance to the individual, so that if an individual sinned they would say to him: an a fortiori argument from David. And this Midrash is very astonishing. Rav Dessler asks: have we ever heard of a person who goes and sins and angers his Maker so that others might learn from him that it is possible to repent?

Rav Dessler explains a wonderful thing: David was fit for atonement even before this. There was in him a fine sin beforehand, and he needed to repent for it, only that he did not sense it at all. And since he did not sense it, he did not know that he needed to correct it. Therefore they caused him to stumble in a great sin, through which he would also perceive the fine sin and repent for both. To what may the matter be compared (a parable that is not within the bounds of honesty, but illustrates the point well): a person whose car got slightly scraped and the fender was scratched. He turned to the insurance company, and they told him that they do not handle such a minor repair, there is a deductible. He is unwilling to leave his new car with an annoying scratch, so he gets into the car, looks for a good concrete pillar, and crushes the entire fender. Now the insurance company replaces the whole fender for him, and once again he has a new car. Certainly one must not do this, it is theft, but this is the parable. The lesson: David had a fine sin that he did not sense, and therefore they caused him to fall into a great sin, so that through it he would also sense the fine one and correct both.

And what was that fine sin? The Chovot HaLevavot says: for a righteous person, a little pride is considered a great transgression, and it harms him more than all the sins of a penitent. And where do we find in David even a trace of pride that was unbecoming of him? In his request: Master of the Universe, why do they not say "the God of David"? And when the Holy One blessed be He told him that he had not withstood a test, he continued: if so, test me, I am worthy, I can withstand the tests. Here was the finest trace of pride, and David did not sense it. Therefore the Holy One blessed be He caused him to stumble, and when he stumbled, he understood: I thought I was great, I thought I was capable of standing firm, and behold I stumbled in such a matter. And indeed we saw in the Gemara that David repented also for the very request itself: "I resolved that my mouth shall not transgress" - would that there had been a muzzle on my mouth and I had not brought forth from my mouth "examine me and test me." He understood that the very request was flawed, that it contained an element of pride.

And with this is also explained "against You, You alone, have I sinned." For at first glance it is difficult: is it permitted to sin so that people should not say that the servant defeated his master? Moreover, what does "defeated his master" mean - does the Holy One blessed be He not want David to withstand the test? On the contrary, His blessed will is that David withstand it and that people also say "the God of David"! Rather, thus explains Rav Dessler: David says before the Holy One blessed be He - You know that on my own I would have been able to withstand the test, "David was not fit for that deed." And why in the end did I not withstand it? Because You made my evil inclination greater than I deserved, and for what purpose? So that I would recognize that I harbor an earlier sin - the sin of pride - and repent for it. This is "against You, You alone, have I sinned": indeed by my own fault, for I should have atoned for the pride, but were it not for that earlier sin that I needed to correct, I would not have stumbled in this sin.

And what is the "way of repentance for the individual" that this matter teaches us? To say to the individual: be careful that there not be in you even a small sin, for a small sin is liable to drag along after it a stumbling into a great sin, so that you will repent also for the small sin. This is the explanation of what happened here to David.

The words of the holy Zohar: the accusation of the Satan and the answer of the Holy One blessed be He

It is brought in the Zohar, part one, page eight, side two. It is written in the Torah "And a man who commits adultery with the wife of another man," and it is written "And with your neighbor's wife you shall not lie carnally, to defile yourself with her." The accuser asked: David, who corrupted the covenant with forbidden relations, what is his law? The Holy One blessed be He said to him: David is meritorious, and the holy covenant stands in its place and its rectification, for it is revealed before Me that she was destined for him and Bat Sheva was fit for him from the day the world was created. The accuser said to Him: if it is revealed before You, before whom is it revealed? Did David go to her out of knowing that she was fit for him? The Holy One blessed be He said to him: what was done was done in a permitted manner, for all those who went out to battle, not one of them would go until he gave a divorce document to his wife, and Bat Sheva was not a married woman.

The accuser said to Him: if so, he should have waited three months and he did not wait. For there is a halachah that a woman who has been divorced does not marry another immediately, but must wait three months of distinction, so that we may know with certainty that she is not pregnant, for otherwise, when the child is born we would not know whether it was born after nine months to the first or after seven to the second. The Holy One blessed be He said to him: in what case is this said? Where we are concerned that perhaps she is pregnant, but it was revealed before Me that Uriah never approached her, and My name is sealed within his to bear witness - for it is written "Uriah" and it is written "Uriyahu," My name is sealed within it that he never had relations with her.

The accuser again said: it is revealed before You, but to David was it revealed? He should have waited three months, for David does not know whether Uriah was with her. Moreover, if You say that David knew he was never with her, why does David send and summon him and command him "Go down to your house and wash your feet"? The Holy One blessed be He said to him: certainly David did not know, but know that David waited more than three months - he waited four months. For thus we learned: on the twenty fifth of Nissan David sent out a proclamation throughout all Israel, and on the seventh of Sivan they were with Yoav, and they went and fought against the children of Ammon - Sivan, Tammuz, Av and Elul - and on the twenty fourth of Elul was what was with Bat Sheva. It turns out that from the time Uriah left his house until David came to her, four months of distinction had passed and not merely three. And on Yom Kippur the Holy One blessed be He forgave him for his sin. And some say that in Adar the proclamation for a general conscription was sent out, and they gathered on the fifteenth of Iyar, and on the fifteenth of Elul was what was, and on Yom Kippur he was informed "the Lord also has removed your sin, you shall not die."

And what does "you shall not die" mean? You shall not die at the hand of Dumah, the ministering angel of Gehinnom. Of this David said: "Had the Lord not been my help, my soul had almost dwelt in Dumah" - had the Holy One, blessed be He, not been my guardian and defender, teaching merit and uprightness on my behalf, my soul had almost dwelt in Dumah. And what does "almost" mean? Like a thin thread, that very measure between me and the sitra achra: there was but a step between me and "my soul had dwelt in Dumah." From here the holy Zohar concludes that a person should be very careful not to open his mouth and pronounce harsh words against himself, for David was almost harmed by pronouncing his own verdict when he said "the man deserves to die."

Why did Uriah not go to Bat Sheva?

We saw in the Zohar that Uriah the Hittite never lived with her, and this is puzzling. There is a midrash (which I have not seen myself, but I have heard it quoted) that says the following: When David sought to draw Goliath's sword from its sheath in order to cut off his head, Goliath's armor bearer was Uriah, who was called the Hittite because he came from the land of the Hittites. David could not draw the sword, and he asked Uriah to draw it. Uriah said to him: What will you give me? He said: I will give you a daughter of Israel as a wife. Some say the sword was bound by sorcery, and Uriah knew the secret of releasing it. Uriah helped him, and in the end David gave him Bat Sheva as a wife. Says the midrash: A heavenly voice came forth and said to him - David, do you treat the daughters of Israel as ownerless property? You promise a daughter of Israel to one who has only just converted, when the level of Israel is higher than the level of a convert? By your life, you are giving him from your own. And who ultimately fell into David's hand? That very Bat Sheva. The midrash further says that David circumcised Uriah, and when he circumcised him he rendered him a kerut shofchah, and therefore David knew that Bat Sheva had never been with Uriah.

But this midrash is puzzling, and there is a difficulty with it: If so, why does David send Uriah down to his house to be with his wife? What I thought to say, though it is somewhat forced: David's intention was not for Uriah's sake but for the people. So that everyone would know Uriah had been in Jerusalem, and they would say he surely went into his house, and when her pregnancy became known they would conclude that the pregnancy was from her husband, and the neighbors would not object: her husband has not been home for months, so how is she pregnant? This is possible, but the matter is still puzzling. However, there are further teachings in Sefer HaGilgulim regarding David, Uriah, and Bat Sheva, and from there we will understand an entirely different explanation.

The secret of the reincarnations: Hevel, Kayin, and the extra twin

It is brought in Sefer HaGilgulim: King David was the reincarnation of Hevel, Uriah the Hittite was from the root of Kayin, and Bat Sheva was the extra twin who was born together with Hevel. For it is written that when Kayin and Hevel were born, a twin sister was born with each of them, and with Hevel an extra twin was born - so it is stated explicitly in the midrash. Each married the twin born with his brother: Hevel married Kayin's twin, and Kayin married Hevel's twin. And this is the meaning of "the world is built through chesed" - that the world was built through chesed. And what is chesed? Forbidden unions are called chesed, as in the verse "it is chesed." There is chesed from the side of holiness, which is the well known help and support, and there is chesed from the side of impurity, which is the matter of forbidden unions, for in forbidden unions too, in the end each gives the other something - only that this is chesed from the side of impurity. But at the time of the world's building there was no choice but to build it in this way.

Over the extra twin born with Hevel, Kayin and Hevel contended, and because of this Kayin rose up and killed Hevel: Hevel held that she was his, since she was born with him, and Kayin held that she was his, since he was the firstborn and takes a double portion. And now they all return in reincarnation: David is Hevel, Uriah is Kayin, and Bat Sheva is that extra twin. And when David sees that the extra twin is again in the hands of one to whom she does not belong, in the hands of Kayin, he rises up and takes her for himself.

And this is what Chazal hinted: "for I am set for a rib," and the school of Rabbi Yishmael taught - Bat Sheva was fit for David from the six days of Creation. For the match is fixed forty days before the formation of the child, so what does "from the six days of Creation" mean? Rather, from the six days of Creation, from when Kayin and Hevel and the extra twin were created, she was already fit for him then, except that Kayin came and took her from him through an act of murder, and now David comes and restores the stolen thing and takes that extra twin. So says the holy Arizal.

And these matters are hinted at in the verses. It says "and Kayin said to Hevel his brother, and it was when they were in the field, and Kayin rose up against Hevel his brother and killed him." "When they were in the field" seems to be superfluous words, but "be-heyotam ba-sadeh" equals in gematria 774, exactly the numerical value of "Bat Sheva" - they quarreled in the field, and over whom did they quarrel? Over Bat Sheva. And likewise "and the Lord said to Kayin, where is Hevel your brother," and he answers "I do not know, am I my brother's keeper" - "ha-shomer achi anochi" equals in gematria "Uriah the Hittite." And also the words "and Kayin rose up against Hevel his brother and killed him" equal in gematria "Uriah the Hittite." Thus the verse itself hints that it refers to Uriah, and therefore David rose up against Uriah and took Bat Sheva from him. And this is what Chazal said: Whoever says David sinned is simply mistaken, for he took what was his. And where was the flaw? "That he ate unripe fruit" - she is coming to you, but in her proper time, and you took her before her time.

And why, at first, did Hevel not merit the extra twin, even though by strict law she was his, since she was born with him? Because there was a sin in him: when Hevel offered his sacrifice, the light of God shone upon him and Hevel gazed at the Shechinah, and since he gazed at the Shechinah, death was decreed upon him, and by the force of that transgression Kayin was able to overcome him and kill him. And note: in the present reincarnation David merits to be a head for ruach hakodesh and the Shechinah. It is said of him "and the spirit of the Lord came upon David from that day forward," and he prays "cast me not away from before You, and take not Your holy spirit from me," and he testifies of himself "the spirit of the Lord spoke in me, and His word was on my tongue." The Shechinah speaks in him - he is indeed rectifying what he damaged in the previous reincarnation, and now merits to behold the Shechinah in a permitted way.

"Go down to your house and wash your feet" - Uriah's test

וַיֹּאמֶר דָּוִד לְאוּרִיָּה רֵד לְבֵיתְךָ וּרְחַץ רַגְלֶיךָ וַיֵּצֵא אוּרִיָּה מִבֵּית הַמֶּלֶךְ וַתֵּצֵא אַחֲרָיו מַשְׂאַת הַמֶּלֶךְ׃ - And David said to Uriah, Go down to your house and wash your feet. And Uriah went out of the king's house, and there followed him a gift of food from the king.

The holy Arizal teaches: Uriah the Hittite came in this incarnation in order to repair his earlier corruption, and the proof is that he indeed repaired it. How? He did not touch Bat Sheva even with a little finger, because he knew that she did not belong to him but to David, and he knew that this was his test: would he, even in this incarnation, take something that was not his? This is what the Zohar means when it says that he never came near her.

And David sought to test him. When Uriah returned from the war, David sent him to his home and said to him, "Go down to your house and wash your feet." David thought: perhaps now, when I grant him permission, he will draw close to her, and then it will become clear that his not approaching her until now was not out of the desire to repair, but out of fear of me, for he knew she was designated for me, and no one dares involve himself with the king's affairs. But if, even though I command him, he will not approach her, that is a sign that it is not out of fear but out of an intention to repair. And indeed Uriah proved that he had come to repair, for even after the king's command he did not go down to his house. This alone should have been enough for David not to harm Uriah the Hittite.

"Set Uriah" - the vengeance of Hevel

וַיִּכְתֹּב בַּסֵּפֶר לֵאמֹר הָבוּ אֶת־אוּרִיָּה אֶל־מוּל פְּנֵי הַמִּלְחָמָה הַחֲזָקָה וְשַׁבְתֶּם מֵאַחֲרָיו וְנִכָּה וָמֵת׃ - And he wrote in the letter, saying, "Set Uriah at the forefront of the fiercest fighting, and then withdraw from him, that he may be struck down and die."

But David bore him a grudge from the previous incarnation. David said: just as he killed me through the impurity of the serpent, for Kayin is "kina dimsa'avuta," the nest of impurity, so too I will kill him by the sword of the Amonites, upon whose sword a serpent was engraved. This is hinted at in the verses before us: "וַיִּכְתֹּב בַּסֵּפֶר לֵאמֹר הָבוּ" - the initial letters of ba'sefer, le'emor, havu are the letters bet, lamed, heh, the letters of Hevel. The verse comes to hint that David wishes to avenge the death of Hevel.

וַיֹּאמֶר דָּוִד אֶל־הַמַּלְאָךְ כֹּה־תֹאמַר אֶל־יוֹאָב אַל־יֵרַע בְּעֵינֶיךָ אֶת־הַדָּבָר הַזֶּה כִּי־כָזֹה וְכָזֶה תֹּאכַל הֶחָרֶב הַחֲזֵק מִלְחַמְתְּךָ אֶל־הָעִיר וְהָרְסָהּ וְחַזְּקֵהוּ׃ - And David said to the messenger, "Thus shall you say to Yoav: Do not let this matter seem evil in your eyes, for the sword devours one as well as another. Press your attack against the city and destroy it. And encourage him."

Here too the matter is hinted at: "וְכָזֶה תֹּאכַל הֶחָרֶב" - the final letters heh, lamed, bet spell Hevel. Once again there is here a repair for having killed Hevel in the previous incarnation. And what is the doubling, "the sword devours one as well as another"? One may say: do not let it seem evil in your eyes that "the sword devours in this way" now, because "the sword devoured in that way" in the past. Just as the sword devoured then, so it devours now, measure for measure. Furthermore, "vechazeh" equals 38 in gematria, the numerical value of "Hevel" with the addition of one. That is: back then you killed Hevel, and this is precisely what the sword devours now, for now the sword devours Kayin.

And nevertheless there was in this a sin on David's part. First, as the holy Arizal says, there is here "you shall not hate your brother in your heart," for Uriah had already repaired, and David himself had tested him and seen that he did not go down to his house, a sign that he had truly come to repair. Second, that he killed him with the sword of the Amonites, on which a serpent was engraved, and in this there was great impurity, and for this he was punished. See how Moshe Rabbeinu acted: when he sought to kill the Egyptian, he killed him with the Ineffable Name. And there too they were those same incarnations: Moshe is the incarnation of Hevel, and the Egyptian the incarnation of Kayin. For Kayin was reincarnated in three principal incarnations, and this is "Kayin shall be avenged sevenfold" - yukam is an acronym for Yitro, Korach, Mitzri, the Egyptian (and there are surely many roots and branches, but these are the principal ones). Opposite him, Hevel was reincarnated in Moshe: Moshe is an acronym for Moshe, Shet, Hevel. It emerges that Moshe kills the Egyptian, that is, Hevel kills Kayin, except that he does it by way of repair, with the Ineffable Name, in holiness and not in impurity. And you, David, should have killed him by way of holiness and not by way of blemish and impurity, and it was over this that the charge was leveled against David.

"Her man" and "her husband" - two terms in a single verse

וַתִּשְׁמַע אֵשֶׁת אוּרִיָּה כִּי־מֵת אוּרִיָּה אִישָׁהּ וַתִּסְפֹּד עַל־בַּעְלָהּ׃ - And the wife of Uriah heard that Uriah her man was dead, and she mourned over her husband.

Why does the verse say once "her man" (ishah) and once "her husband" (ba'lah)? In the Holy Tongue there is a difference between the two. "Ba'al" is a term of lordship and ownership. There are women today, among the various progressive types, who are repelled by the term "my ba'al" - is he my owner? - and prefer to say "my ish." And indeed "ishi" is an expression of closeness and affection between a man and his wife, as the verse says, "you shall call Me ishi and shall no longer call Me ba'ali."

And here let us take note: those who came to bring her the news were certain that she and Uriah were still married and everything was as usual, and so they spoke to her in a term of closeness and affection, "Uriah your man is dead." But she already knew that she was not married to him, for David had already taken her, and once Uriah died she was considered divorced from that earlier point, and therefore she understood that there was here no marriage and no affection. Over whom, then, does she mourn? Only from the aspect of "her husband," from that ownership and lordship he had over her, and not from the aspect of "her man," not from the aspect of affection.

"When the mourning was over" - why did David act so quickly?

וַיַּעֲבֹר הָאֵבֶל וַיִּשְׁלַח דָּוִד וַיַּאַסְפָהּ אֶל־בֵּיתוֹ וַתְּהִי־לוֹ לְאִשָּׁה וַתֵּלֶד לוֹ בֵּן וַיֵּרַע הַדָּבָר אֲשֶׁר־עָשָׂה דָוִד בְּעֵינֵי ה'׃ - When the mourning was over, David sent and brought her into his house, and she became his wife and bore him a son. But the thing that David had done was evil in the eyes of Hashem.

As soon as the seven days of mourning had passed, David sent and gathered her into his house. The Abarbanel raised a question: why did David rush so much to bring Bat Sheva into his house, for it seems from this, as it were, that he was still driven by desire, as he puts it. The Malbim answers: here too, one who studies the pesukim sees that what David did he was compelled to do. For had she continued in her pregnancy and he married her only afterward, the matter would have aroused suspicion, since she was already pregnant, perhaps pregnant from Uriah the Hittite, and people would have thought the son was Uriah's. Therefore David had to take her as quickly as possible, so that when the pregnancy became known two months later, and it was already visible that she was carrying, everyone would say: after all, David married her. And even when she gave birth, though it was too soon, at seven months, we have learned that in those times it was accepted that a woman gives birth either at seven or at nine months, and people would say the child was born to David at seven months. David was compelled to do this in order to cover the fact that this son was not Uriah's but his own, and also to preserve the honor of the monarchy, for if it became clear that there was something unclean here, it would be a disgrace to the monarchy, and the monarchy might crumble as a result.

The Malbim adds further: David's taking of her was not at all puzzling in the eyes of the public, for the matter appeared as a king showing grace to the wife of the hero who fell on the battlefield. The king did her a kindness, took her under his protection, and turned the hero's wife into a queen. And so the matter appeared in the eyes of the people as something very positive, that David honors his warriors. And although it is not to a king's honor to marry a woman who was already married, and seemingly he should marry a virgin, here the matter actually appeared for the good: David the king showing grace to his warrior and taking his widow.

In summary:

The episode of David and Bat Sheva is not as it appears to the superficial observer. According to the Malbim, every single step David took after the deed was done out of necessity, to preserve the honor of the monarchy and to prevent suspicion. According to Chazal and Rav Dessler, the failure itself came so that David would recognize the fine sin of "Examine me, Hashem, and test me" and repent of it, and from here we learn a path of teshuva for the individual: that a small sin can drag along a great sin so that a person will repent of both. According to the Zohar, the deed was done with permission and with a proper waiting period, and David was atoned for on Yom Kippur, yet still "my soul had almost dwelt in silence," and from here we learn that a person should be careful with his mouth. And according to the holy Arizal, Bat Sheva was his from the six days of creation, and "he took what was his," except that "he ate the fruit unripe" and that he killed Uriah with a sword that has impurity in it, and in this lay the claim against him. The episode still does not end here: in the next chapter we will see the rebuke and the very heavy price that David pays for it.