"David was a great man who yet did some bad things. It's the reason he was banned from building the Temple - because he had bloodied his hands, God informed him that his son would be building the Temple instead." (source)
"The universal expectation is that the Messiah will be a descendant of David ha-Melech." (Glinert)