To be on the throne, a king must prove both his legal right and royal right to be there. To prove Jesus’ legal right to be King, He must be of the bloodline of David as promised in 2 Samuel 7:14. This cannot be proven through the genealogy in Matthew’s gospel though. Joseph, Jesus’ earthly father, could not be His biological father due to a curse placed on his ancestor Coniah in Jeremiah 22:30.
However, Joseph adopted Jesus which proved Jesus’ royal right to the throne. This is where Luke’s gospel comes in. He uses a different genealogical line from David. Instead of tracing the ancestry through Solomon, the most well-known son, he uses another of David’s sons, Nathan, to give his lineage to Mary, Jesus’ mother. This proves Jesus’ legal right to the throne. Between these two records the men prove that Jesus has both the legal right and royal right to be the King He says He is.