If you refer to Joseph as the father of Jesus, yes he was in the line of David, but you would not be speaking of His actual father, which we all know is God, through the Spirit.
I understand the true Father of Jesus, but if you recall, they went to Bethlehem, the City of David, to be taxed when Jesus was born. His earthly lineage was primarily counted through Joseph in the Jewish perspective.