According to biblical tradition, although David bought the land for the Temple and carefully assembled its building materials, he was deemed unworthy of constructing the Temple because he was a man of war with blood on his hands.
David bought the land for the church.