If both the scripture and traditions of the Church are reliable and trustworthy, then why are there many false/spurious gospels and letters, not just gnostic ones, that were falsely attributed to the Apostles or early Christians and used to support later formulations of doctrines. I am thinking about the many infancy gospels, letters by St. Ignatius and St. Clement, for example. Why would anyone create such a thing of there was nothing to hide?
I ask this question not to accuse the Church, or any of the early Christians, I just wish to understand how these texts came about.
Can anyone help?
I suppose that it is a case of the "end justifies the means" philosophy held by some. Someone thought that the church was wrong on issue X, or that it needed to be corrected, so, rather than simply make their own arguments and consultations, they attempted to present "authority" for the proposition that they were teaching.
Sometimes something was genuinely misattributed. After the passage of time, it is easy to get such issues confused if they are not defined early on.
Or it might have been an out-and-out fraud. See, e.g., the Donation of Constantine for an example of such a work with major political ramifications.
These problems are by no means limited to antiquity. Non-Mormon historians, scholars, and theologians speculate as to which of these categories Joseph Smith's writings (The Book of Mormon, etc.) fall into, for example.
There is also an argument floating around out there somewhere that back then sometimes people wrote in the name of a certain individual, not claiming to be him, but to identify with his particular school of thought. According to this theory, our modern concept of "plagiarism" (of an idea or an identity) in its fullness simply didn't exist then. Literal authorship simply wasn't important. This is the stuff of "higher criticism theory," though, which I tend to shy away from.
The final word is that the Church ultimately rejected these spurious books and vain attempts, and did not canonize them. Through the power of God they discerned truth from error. We can rest on Jesus' promise: "[W]hen he, the Spirit of truth, is come, he will guide you into all truth." (John 16:13.)