Why David?

In 2 Samuel 7, why was David picked to be king? Why he was labeled as the man after God's heart?

God may not tell us the exact reason He chose David as king, but He does tell us how He came to His conclusion. When Samuel kept thinking that the next king would be one of Jesse's older sons, God told him, "Look not on his countenance, or on the height of his stature; because I have refused him: for the LORD seeth not as man seeth; for man looketh on the outward appearance, but the LORD looketh on the heart" (1 Samuel 16:7But the LORD said unto Samuel, Look not on his countenance, or on the height of his stature; because I have refused him: for the LORD seeth not as man seeth; for man looketh on the outward appearance, but the LORD looketh on the heart.
See All...). Samuel was looking at the outer appearance and the obvious qualifications. God looked straight into the heart. And from the choice He made of David, we know that He liked what He saw there.

Interestingly, your second question fits quite well with the first. Perhaps what God saw in the heart of David was that he was a man after God's own heart. The Lord had Samuel tell Saul, "But now thy kingdom shall not continue: the LORD hath sought him a man after his own heart, and the LORD hath commanded him to be captain over his people, because thou hast not kept that which the LORD commanded thee" (1 Samuel 13:14But now thy kingdom shall not continue: the LORD hath sought him a man after his own heart, and the LORD hath commanded him to be captain over his people, because thou hast not kept that which the LORD commanded thee.
See All...). Obviously, God was looking for this kind of a man to be king--a man after His own heart. In Acts 13:22And when he had removed him, he raised up unto them David to be their king; to whom also he gave their testimony, and said, I have found David the son of Jesse, a man after mine own heart, which shall fulfil all my will.
See All..., David is called, "a man after mine own heart, which shall fulfil all my will."

What does it mean to be a man after God's own heart? Let's look at the evidence. David is contrasted with Saul who did not obey the commandments given to him by the Lord. So, this man is one who obeys God's commandments. Acts 13:22And when he had removed him, he raised up unto them David to be their king; to whom also he gave their testimony, and said, I have found David the son of Jesse, a man after mine own heart, which shall fulfil all my will.
See All... says that this man is one who will fulfill all the will of God. He does what God wants him to do. This reminds me of Jesus who stated, "My meat is to do the will of him that sent me, and to finish his work" (John 4:34Jesus saith unto them, My meat is to do the will of him that sent me, and to finish his work.
See All...) and "I came down from heaven, not to do mine own will, but the will of him that sent me" (John 6:38For I came down from heaven, not to do mine own will, but the will of him that sent me.
See All...). Certainly Jesus was One who was after God's own heart.

This also makes me think of what Jehu said to Jehonadab when he offered to take him up in his chariot, "Is thine heart right, as my heart is with thy heart?" (2 Kings 10:15And when he was departed thence, he lighted on Jehonadab the son of Rechab coming to meet him: and he saluted him, and said to him, Is thine heart right, as my heart is with thy heart? And Jehonadab answered, It is. If it be, give me thine hand. And he gave him his hand; and he took him up to him into the chariot.
See All...). Jehonadab answered that it was and he rode in the chariot with Jehu as he poured God's wrath out on the house of Ahab. They were of the same heart and mind.

With this evidence, I believe that to be a man after God's own heart is to have a heart for the same things God has a heart for. That is, this man wants only that the will of God be done. He seeks after those things that please God. He is quick to obey His commandments. He finds what direction God is going and then he charges with all his might in that direction. May we all learn to be men or women after God's own heart.