In my previous posts I indicated that the “Letter of Barnabas” was not actually written by Barnabas (named as an apostle in Acts 10-15). In fact, it could not have been, since it is almost certainly to be dated to the 130s CE (for reasons I could explain if anyone really wants to know….). Barnabas, the companion of Paul, must have died no later than the 70s CE, more likely the 60s – some seventy years before this letter was written. So Barnabas couldn’t have written it.
So why was the (rather long) letter of Barnabas – which in fact is anonymous – eventually attributed to Barnabas, the companion of Paul?
I dealt with this question once (and only once in my entire life, I believe); it was something like thirteen years ago on the blog (!). And here’s what I said:

Dr. Ehrman,
For Marcion, if the God of the Hebrew Bible (Creator God) is in opposition to Christ and the God(s) of what would eventually become the Trinity, what then happened to the God of the Hebrew Bible? Gods are immortal, of course, and I can’t imagine they’d take kindly to another God’s interference in his plans.
Monotheism, especially in early Christianity, seems to be a very malleable concept!
For Marcion the God of the Hebrew Bible appeared to continue living on (though I don’t know that he ever actually discussed it). The Stranger God saved people from that God, but I don’t believe he thinks he destroyed him.
Was second century Christianity writing literature to rationalize the failed prophecies of the first century Christianity?
Most of it was not — it wsa dealing with other issues. There were lots and lots of those. And very little second century literature tried to defend the earlier writings of the NT or explain them. They were simply appealed to as authorities.
I was watching Alex O’Connor interviewing Elaine Pagels. She discussed the “secret teachings” of Jesus, as mentioned in Mark 4. What are your views on these teachings, which I believe are only found in certain Gnostic Gospels, such as the Gospel of Thomas?
I’d say the teachings in Mark 4 are secret in a very different way from what you find later in the Gnostics. In Mark Jesus indicates that he teaches outsiders only in parables “so that” they may not understand and turn back to God; but the parables are not mind-boggling truths the way later Gnostic myths are. He says it in particular about the Parable of the Sower: not a lot of weird cosmology going on there!