This has been a subject that has been explored by many secular scholars today. Bart Ehrman is one of them. The Divinci Code had this to say about why the gospels were chosen:
"Because Constantine upgraded Jesus' status almost four centuries after Jesus' death, thousands of documents already existed chronicling His life as a mortal man. To rewrite the history books, Constantine knew he would need a bold stroke. Constantine commissioned and financed a new Bible, which omitted those gospels that spoke of Christ's human traits and embellished those gospels that made Him godlike. The earlier gospels were outlawed, gathered up, and burned."
This comment has largely been discredited, although some still hold to this view without doing the research. That the Council of Nicea in 325 reviewed 80 gospels and decided to adopt only the 4 is nonsense. The gospels of Matthew, Mark, Luke, and John had long since been adopted by the church as the only authoritative Gospels.
What was the view of the early church, including the church fathers, about the 4 gospels and the reason they are to be considered canonical, while the gnostic gospels were to be rejected?
The understanding of the early church was that Jesus had given only his apostles, the twelve and Paul, the authority to to proclaim Jesus' identity and mission to the world. They were eyewitnesses of His resurrection, they were given understanding by Jesus Himself regarding His claims and teachings, and Jesus appointed Paul to be the thirteenth apostle and made him an eyewitness to the fact that Jesus had been resurrected. The apostles were to test the truth of any and all who claimed to speak for Jesus.
The early church also believed that the apostles were the only ones that had the authority to speak and write for Jesus. Clement (c. 95) said: "The apostles have preached the gospel to us from the Lord Jesus Christ. Jesus Christ has done so from God. Christ therefore was sent forth by God, and the apostles by Christ."
Ignatius (c. 105) also said that the Christians were to study and be established in the doctrines of the Lord and the apostles.
Polycarp (c. 117) said: "Let us therefore so serve God with fear and all reverence as He Himself gave commandment and the apostles who preached the gospel to us and the prophets who proclaimed beforehand the coming of our Lord."
Irenaueus (c. 180) said, "For the Lord of all gave to His apostles the power of the gospel through whom also we have known the truth, that is, the doctrine of the Son of God." He also said: "...the apostles, likewise being disciples of the truth, are above all falsehood."
Irenaeus also said of Polycarp: "Polycarp was instructed by apostles, and he spoke with many who had seen Christ."
Tertullian (c 197) said: "The apostles were ignorant of nothing and they preached nothing that contradicted one another."
The early church only accepted only what the apostles taught. The four NT Gospels were written in the first century, and then collected by the church as the only authoritative gospels from the apostles. They did not accept anything that was written after the apostles died. The earliest of the Gnostic Gospels was the Gospel of Thomas. This has been dated to 150 AD, far after the other gospels were already written and in use by the church.
Reading the Gnostic Gospels has been very interesting. Almost immediately one notices that they stand in contrast to the style, content, and teachings of the NT Gospels. They rarely have any reference to any date, time, or place.
All of the Gnostic Gospels have a set of common ideas or themes that run through them. That is why they are labeled "Gnostic" texts. They don't merely describe another Christianity. They read like they are an attempt to specifically subvert the core teachings of Christanity. While reading them it almost seemed purposeful to me. Not merely describing things differently, but attempting to argue against the NT gospels. This could be why Irenaeus wrote that he was writing against heresies because there were those who draw away many under a pretense of knowledge. Epiphanius spoke of "practicing Gnostics", which is how we received the name given to these writings.
These Gnostic texts are not "secret" like some would claim. The early church fathers knew about these texts 1500 yeas ago and were exposing them as false.
The early church rejected the Gnostics because they contradicted the teaching of the apostles.
Ignatius c. 105
How much more will this be the case with anyone who by wicked doctrine corrupts the faith of God, for which Jesus Christ was crucified! Such a one becomes defiled. He will go away into everlasting fire, and so will everyone that listens to him (Ephesians 16)…But if, as some that are without God, that is, the unbelieving, say, He became man in appearance [only], that He did not in reality take unto Him a body, that He died in appearance [merely], and did not in very deed suffer, then for what reason am I now in bonds, and long to be exposed to the wild beasts? In such a case, I die in vain, and am guilty of falsehood against the cross of the Lord. (Trallians 10)
How the Valentinians pervert the Scriptures to support their own pious opinions…This, then, is their system, which neither the prophets announced, nor the Lord taught, nor the apostles delivered. However, they boast that they have a perfect knowledge, beyond all others. They gather their views from other sources than the Scriptures. (Against Heresies 1.8)
The early church also stated that the four NT gospels refute the Gnostics.
The Ebionites, who use only Matthew’s Gospel, are refuted out of this very same work, making false suppositions with regard to the Lord. But Marcion, mutilating the Gospel according to Luke, is still proved to be a blasphemer of the only existing God, from those passages which he still retains. Those, again, who separate Jesus from Christ, alleging that Christ remained impassible, but that it was Jesus who suffered, prefer the Gospel by Mark. However, if they read it with a love of truth, they would have their errors rectified. Those persons, moreover, who follow Valentinus, make copious use of the Gospel according to John to illustrate their conjunctions. However, they, too, will be proved to be totally in error. (Against Heresies 3.7)
There is no evidence that I can find that any of the early church fathers accepted anything BUT the 4 NT Gospels.
Ben Witherington, Professor of NT at Asbury Theological Seminary put it very good:
“Before we turn to these documents, it is important to state a crucial principle of historical study: It is always more likely that those sources that come from eyewitnesses or those who were in contact with eyewitnesses will provide us with the best data about an ancient person than documents that were composed several centuries later, as were the Gnostic Gospels. There would need to be clear and compelling evidence corroborated by several later sources for us to take the word of later documents that Jesus was married. There is no such evidence, even in the Gnostic Gospels.” (The Gospel Code, p.32)
“The essential question is, ‘What were the earliest documents (and what do they say)?’ The answer is the New Testament itself. We have no documents earlier than these, and as any good historian knows, the documents closest to the source of a movement are likely to be most revealing about its origins. The documents written by eyewitnesses or those in contact with eyewitnesses are our primary sources, and these documents happen to be in the New Testament, plus a few other likely first-century documents, such as the Didache and 1 Clement.” (The Gospel Code, p.118)