Were certain books excluded from the Bible Canon because of something the church was hiding?
In short, no. The idea that there is some kind of conspiracy in how the Bible came together, and that some books were “hidden” because of some embarrassment to the church lacks credence as much as it does historical knowledge. Ignorance of facts and hatred for the Medieval Church fuels the myths of this sort, which is precisely what the early church is accused of in this legend.
“Canon” means “rule” or “standard.” In the second century, before there was an official “Bible,” a standard was set for proper teaching in corporate worship by selecting which writings were acceptable for the church. The Jewish Canon of what Christians call the Old Testament was generally accepted. Irenaeus, in the second century A.D., called for the “Catholicity” and “Apostolicity” of any and all accepted books as a standard.
“Catholicity” means that any book that was to be used in public worship had to be one recognized by all the church and not just certain corners of it. “Apostolicity” means that any book that was to be used in public worship had to be one written by an apostle or, at least, an eye-witness of an apostle.
The first Christian canon from antiquity is known as the Muratorian Canon (2nd century) [believed by many to be based on the collection of Origin of Alexandria]. Some scholars believe it to be a reaction to a heretic of the times, a man named Marcion. Marcion created a canon of his own, which consisted only of a mutilated Gospel of Luke (with any reference of Israel’s promises removed) and ten letters of Paul. At any rate, the Muratorian Canon contained, as its core, the “Pauline Canon.” The Pauline Canon was thirteen letters contributed to the Apostle Paul (the Letter to the Ephesians has instead, “To the Laodiceans”). The four Gospels and the Acts of the Apostles were present. The letters of Jude and 1st and 2nd John are also included. Yet another inclusion is the “Book of Wisdom.” The books 3rd John, 1st and 2nd Peter, Hebrews, and Revelation are not contained, listed, nor mentioned.
Athanasius, in his Easter Letter (A.D.367), lists the exact 27 books of the present 21st century Bible as “being canonized… as they have been received.”
In Africa, the Synod of Hippo (A.D.393) and the Councils of Carthage (A.D. 397 and 419) [overseen by Augustine of Hippo] canonized the same 27 books.
They also canonized the Septuagint (the Greek version of the Jewish canon) to “close” the canon of the Bible.
Incidentally, other writings were read and used for teaching (though not for public worship), such as “The Shepherd of Hermes,” writings from “Clement,” and many writings not included in the Jewish canon but respected nonetheless.
The Latin Vulgate (Roman Catholic) includes the Apocrypha as canonized. Eastern Orthodox recognize 1 Esdras, Psalm 151, The Prayer of Manasseh, and 3 Maccabees.
The Russian Orthodox adds to this 2 Esdras.
These additions were rejected by most (if not actually all of the ancient fathers) as authorized, but certainly good for edification.
So, unless this conspiracy began in the late first century or at the latest the early second century (which confounds all reason for lack of need) there is simply no evidence of a cover-up by the church. The only books that ever caused any controversy were actually books that, in fact, made it into the canon (especially James). And two books were used as much as the canon, but were not canonized – 1 Clement and the Shepherd of Hermes.
The books of controversy today (the Gnostic books) were never in contention because they were not “handed down” from the apostles and eye-witnesses.