the author of the Epistle of Barnabas interpreted the Mosaic Law as if it were mere allegory. Jesus didn't.
No. Perhaps you're not aware of this, but in Biblical exegesis, there are multiple levels of interpretation, and these views have been around since Christians began interpreting the Old Testament--in other words, from the very start. You have the literal level, the moral level, and the spiritual level. Everyone can see the literal level, but Barnabas wanted to show us the lessons that the Law teaches us, beyond the rote "Don't wear clothes made of this and that, and refrain from eating this, and you have to do this when your neighbor is in that situation, and you should treat your family this way, and your servants that way, and your neighbors in this way". Barnabas is saying, "When we follow x part of the Law, we should keep in mind how we can apply this commandment to other parts of our lives that don't concern this literally, but have the same meaning."
In fact, St. Paul does the exact same thing Barnabas does in taking the Law and giving it a figurative application! See 1 Corinthians 9:
3 My defense to those who examine me is this: 4 Do we have no right to eat and drink? 5 Do we have no right to take along a believing wife, as
do also the other apostles, the brothers of the Lord, and Cephas? 6 Or
is it only Barnabas and I
who have no right to refrain from working? 7 Who ever goes to war at his own expense?
Who plants a vineyard and does not eat of its fruit? Or who tends a flock and does not drink of the milk of the flock?
8 Do I say these things as a mere man? Or does not the law say the same also? 9 For it is written in the law of Moses, “You shall not muzzle an ox while it treads out the grain.”[a] Is it oxen God is concerned about? 10 Or does He say it altogether for our sakes? For our sakes, no doubt, this is written, that he who plows should plow in hope, and he who threshes in hope should be partaker of his hope. 11 If we have sown spiritual things for you,
is it a great thing if we reap your material things? 12 If others are partakers of
this right over you,
are we not even more?
Nevertheless we have not used this right, but endure all things lest we hinder the gospel of Christ. 13 Do you not know that those who minister the holy things eat
of the things of the temple, and those who serve at the altar partake of
the offerings of the altar? 14 Even so the Lord has commanded that those who preach the gospel should live from the gospel.
So what does that say about the writers adherence to the views of Jesus? Doesn't it tell you that he was not in tune with Christs views?
Christ upbraided the Pharisees for their overly legalistic and literal view of holding the Law. Barnabas shows how even the more apparently legalistic parts of the Law can be understood to teach us love, mercy and justice, which Jesus taught were the most important parts. Jesus says in Matthew 23:23...
“Woe to you, scribes and Pharisees, hypocrites! For you pay tithe
of mint and anise and cummin, and have neglected the weightier
matters of the law: justice and mercy and faith.
These you ought to have done, without leaving
the others undone.
So no, Barnabas and Christ are not at all in disagreement with one another. Barnabas shows how to better follow the commandments of Christ regarding the law.
Therefore, could we consider that piece of writing as inspired by God...or as under instruction by Christ? Of course not.
Actually, we can. You just have to actually read it and compare it to the Gospels.