Why did the "lost gospels" lose out? Ben Witherington is unconvinced by The DaVinci Code's account:
[B]y the New Testament period, there was already a core of documents and ideas by which Christians could evaluate other documents. The New Testament documents already manifest a concept of "orthodoxy," or at least criteria by which truth and error could be distinguished. Among the second-century lists of authoritative Scriptures, never are gnostic texts listed—not even by the unorthodox Marcion in about 140. There was never a time when a wide selection of books, including gnostic ones, were widely deemed acceptable.
A good example of this is Serapion of Antioch (a bishop from 190 to 211), who let some of his flock read the Gospel of Peter in church—until he read the book himself. He concluded that it had a heretical Christology, teachings about Jesus that did not conform to other ancient apostolic documents. Or compare the Apocalypse of Peter with the canonical gospel portraits of Jesus' Passion. The gnostic text depicts Jesus as glad and laughing on the cross, a radiant being of gnostic light (81:10-11).
And where did Brown's nonsense come from? What's the purpose of it?
The novel expresses in popular form what some scholars have been arguing or implying for years. Twenty years ago, Elaine Pagels wrote The Gnostic Gospels, a book that introduced the larger public to the other "Christian" writings that arose in the early centuries of the church. Regarding the books of the New Testament, Pagels asked, "Who made that selection, and for what reasons? Why were these other writings excluded and banned as 'heresy'?"
For Pagels this wasn't a rhetorical question, but one designed to get readers to question the very authority of the New Testament.
It's well worth your time to read Witherington's exploration of this nonsense.