Most antiquities scholars think that the New Testament gospels are "mythologized history." In other words, based on the evidence available they think that around the start of the first century a controversial Jewish rabbi named Yeshua ben Yosef gathered a following and his life and teachings provide...
Iirc the gist of the issue why they wrote that was the same as the problem with Jesus being descendant of David through Joseph - he needed to fit into the messiah prophecy. And he couldn’t do that being a Galilean. Ancient Judeans were pretty chauvinistic overall in who is counted to even be a true Jew, remember the background of a tale of good Samaritan or how Herod was constantly bashed for being Edomite despite building spectacular center of worship.