"But the history of David furnishes no countenance to sin. It was when he was walking in the counsel of God that he was called a man after God's own heart. When he sinned, this ceased to be true of him until by repentance he had returned to the Lord. The word of God plainly declares, “The thing that David had done was evil in the eyes of the Lord.” 2 Samuel 11:27 , margin. And the Lord said to David by the prophet, “Wherefore hast thou despised the commandment of the Lord, to do evil in His sight? ... Now therefore the sword shall never depart from thine house; because thou hast despised Me.” Though David repented of his sin and was forgiven and accepted by the Lord, he reaped the baleful harvest of the seed he himself had sown. The judgments upon him and upon his house testify to God's abhorrence of the sin. PP 723.1"
"And when the mourning was past, David sent and fetched her to his house, and she became his wife, and bare him a son. But the thing that David had done displeased the Lord."
Ellen White directly references 2 Samuel 11:27 in this passage.
"Heretofore God's providence had preserved David against all the plottings of his enemies, and had been directly exercised to restrain Saul. But David's transgression had changed his relation to God. The Lord could not in any wise sanction iniquity. He could not exercise His power to protect David from the results of his sin as He had protected him from the enmity of Saul. PP 723.2"
"But your iniquities have separated between you and your God, and your sins have hid his face from you, that he will not hear."
Both passages discuss how sin separates individuals from God and affects His protection or favor.
"prosperity had been attributed to his conscientious obedience to the commandments of the Lord. But now his subjects, having a knowledge of his sin, would be led to sin more freely. His authority in his own household, his claim to respect and obedience from his sons, was weakened. A sense of his guilt kept him silent when he should have condemned sin; it made his arm feeble to execute justice in his house. His evil example exerted its influence upon his sons, and God would not interpose to prevent the result. He would permit things to take their natural course, and thus David was severely chastised. PP 723.3"
"Be not deceived; God is not mocked: for whatsoever a man soweth, that shall he also reap."
The EGW passage directly illustrates the principle of reaping what you sow, as David's sin leads to negative consequences in his family and kingdom.
"But if ye will not do so, behold, ye have sinned against the Lord: and be sure your sin will find you out."
Both passages highlight the idea that sin will eventually be exposed and bring consequences. David's sin, though initially hidden, eventually had repercussions.
"For a whole year after his fall David lived in apparent security; there was no outward evidence of God's displeasure. But the divine sentence was hanging over him. Swiftly and surely a day of judgment and retribution was approaching, which no repentance could avert, agony and shame that would darken his whole earthly life. Those who, by pointing to the example of David, try to lessen the guilt of their own sins, should learn from the Bible record that the way of transgression is hard. Though like David they should turn from their evil course, the results of sin, even in this life, will be found bitter and hard to bear. PP 723.4"
"Good understanding giveth favour: but the way of transgressors is hard."
Both passages state that the path of sin is difficult and leads to hardship. The EGW passage uses David's experience to illustrate this principle.
"For the wages of sin is death; but the gift of God is eternal life through Jesus Christ our Lord."
The EGW passage illustrates the principle that sin has consequences, even if there is a delay before they are manifested. This aligns with the idea that the wages of sin is death (or negative consequences).