I think your taking bibical passages to literally. Jesus is called the Son of God but Jesus is not the biological son of God. Jesus is called the Son of David but he is not the son of David. I'm not sure what you expect though. Was Jesus supposed to be born in the womb of Joseph? Even if we suppose that Mary's lineage was of the line of David, then Jesus still could not be called the son of David using your literal thinking.