2 Chronicles 6:8 But the Lord said to my father David, “You did well to have it in your heart to build a temple for my Name.
This is one of those verses that we need to read in context to find out the deeper meaning. On the surface it is just God telling David He was pleased that David wanted to build a temple.
But when we dig a bit deeper we find out a few secrets; the first being that David was not the one to build the temple because of the sin in his own life.
The second being that God was showing David forgiveness by allowing him to continue to plan and gather everything required for that temple build.
God wants us to grow and not to be held back by the sin in our past.