First, both Paul and James argue that a faith without works is not a saving faith. When Paul argues that one is justified by faith choris "apart from," "distinguished from" works, he is also careful to argue that such a faith produces a freedom from sin and a bondage to righteousness, so much so that those who live by faith are the same who walk by the Spirit and produce good works. In fact, Paul calls this faith working through love. This is in contrast to circumcision being the sign that one is saved and will receive the promises of Abraham. Nowhere in Paul do we see the idea that one is saved by a faith that does not produce good works.
Pauline theology itself is concerned about God fulfilling his predetermined plan of making his people holy (see Ephesians), which includes both the work of God by grace through faith placing us in Christ, and a result of our being unified and becoming holy in our daily conduct as imitators of God.
Hence, when James uses terminology from Paul to counter the idea that one can have a faith that does not produce good works, he is likely quoting the antinomians who have twisted Paul's view of justification by faith alone into being justified by a faith that is alone.
But on the question as to whether one must have a faith that produces works, and that alone is saving faith, both James and Paul agree. The Pauline teaching in the pastorals even clarify the kind of grace that is saving.
For the grace of God that saves all sorts of men has appeared, training us to reject godless ways and worldly desires and to live self-controlled, upright, and godly lives in the present age, as we wait for the happy fulfillment of our hope in the glorious appearing of our great God and Savior, Jesus Christ. He gave himself for us to set us free from every kind of lawlessness and to purify for himself a people who are truly his, who are eager to do good. (Titus 2:11-14)
The Pauline teaching is not opposed to the teaching in James, but many antinomians who were misreading Paul are the likely targets of James' critique (see 2 Pet 3:15-17, as well as Paul's own anticipation that he would be misread in this way in Rom 6:1-4).
Second to this, it must be said that Paul is not arguing against the idea that saving faith is a faith that displays works. He is arguing against the idea that one must become Jewish in order to receive the promises of Abraham. Hence, the issue is whether Gentiles should become Jewish via circumcision. Paul's answer to this is an absolute negative. But we are also told in Acts that James agrees with Paul on that point as well (Acts 15:1-29).
So we are told that Paul, Peter, and James all agree on the subject that Paul is actually teaching in Romans and Galatians.
And, in fact, James isn't talking about circumcision and whether one must become Jewish in order to be saved in his work. There seems to be some assumption that he is addressing the same thing that Paul is addressing when, in fact, he is addressing the antinomian twisters of Paul's theology who are now quoting Paul as though he was teaching that one is saved by a faith without works, rather than one being justified by a faith in distinction from the works that it produces.
Third, there is confusion over the word dikaiō "to be made righteous." In Paul, the term is often in the context of Christ making one righteous via his union with Him by faith. But James is concerned in his context about Christians actually doing what is right and being made right in terms of their daily living. One is a being made right via Christ's historic work and the other via Christ's practical work. This changes the way each of these men speak of "justification." We anachronistically use the word across the board to refer to one's being made right before God vicariously through Jesus Christ, but the term is used in a variety of ways and nuanced by various contexts. James sees faith and works making one righteous, making one like Christ, saving/sanctifying him in the day to day. Paul is talking about one's being positionally made right before God. These are not the same thing.
Four, let's say that this confusion is not just with the reader, but that Paul and James actually misunderstood one another. Let's say that James thought Paul was teaching what the antinomians who took him out of context were teaching. Let's say Paul actually meant to accuse James, and not just certain men from James, that were arguing that the Gentiles must be circumcised (a strange perspective though if Luke's account of the Jerusalem Council is to be taken seriously). As mere men, it is very possible that they could have. I don't think so, but let's just grant the argument for a moment.
Does this somehow negate the orthodox understanding of inspiration and inerrancy? Hardly. The human reasons why a biblical text is written makes little difference to the end product. James' work is good teaching. Paul's works are good teaching. They each emphasize different things, provide clarification for one another, etc. The divine purpose in using human misunderstanding or even just a feeling that one needs to clarify what is said, even the idea that one may need to contradict it, simply provides the motivation for writing a work. In the end, as I've argued above, James doesn't contradict Paul, nor Paul James. In fact, they both say the same thing with different points of emphasis.
Indeed, this fabricated conflict between the works, regardless of what the men thought, is perpetuated by the fact that Western culture tends to read Paul more like the antinomians and James more like the Judaizers. In fact, neither one of them fit into either one of those camps. In fact, James argues in his work that one ought to show mercy since the law demands absolute perfection and no one accomplishes it, thus becoming guilty of the whole law. Hence, if we are to be judged by the law of freedom (2:12), we should seek to be merciful as those who will seek mercy on the day of judgment. In other words, we are saved by mercy, not by the works of the law. Sounds very Pauline to me.
In any case, I think that it is reasonable to see that both the fragmentation of liberal scholarship's reading of the Scripture and an honest misreading of the issues each text is addressing has led to what has now become an unquestioned assumption in mainline scholarship these days. I just think good linguistics and a close reading of the texts in their respective literary contexts will evidence what each is actually arguing and prevent us from making up contradictions in the text that don't actually exist.