Yes He was. Your point?
He needed it so that His Son, who would come AS A MAN to die for the sin of mankind, would be of the very lineage of those kings, TO BE CALLED KING OF KINGS! IT WAS PART OF HIS PLAN, MARKE!
Once again, you IGNORE the fact that in Deuteronomy 17, God has laws...