"For is God the God of the Jews only?"
St. Paul tells you exactly what "works of the Law" means in this passage: it's the ceremonial Law of the Sinai Covenant, most especially circumcision.
The Holy Spirit is incapable of self-contradiction. Any theology which dismisses James 2 by setting Romans or Galatians up in contradiction to it is a false theology. Unless, of course, you're prepared to argue, as Luther did, that James is not Scripture at all.
(For example, you defend the institution of your "priesthood" on the basis of OT Law. But the Book of Hebrews tells you that you need to stop doing this. The OT was typological. Its institutions are not normative for the Church. This is seen in the very fact that the New Testament specifically declares that ALL true believers are priests. Your determination to continue the OT system militates against this.)
Besides, I don't think Luther ever clearly denied that the Epistle of James is in the Canon of Scripture. Some of his warmest, most practical sermons were from the Epistle of James. And there were quite a lot of these sermons.
Luther did refer to the Epistle of James as "an epistle of straw." I will not try to defend his statement. But I will point out that he was ultimately maintaining what I have maintained throughout this thread. The Epistle of James is necessarily subordinated to the systematic-theological Book of Romans. You can't sum James and Paul and come up with a proper doctrine of justification.