Heidegger's Bible Handbook: James: Occasion of the Epistle
5. The occasion for the Epistle was twofold, the afflictions of the faithful and the distortion of the Apostolic doctrine concerning justifying faith.
What occasion James had for the writing of this Epistle, he does not hide, James 1; 2. Namely, without both tyrants and unbelieving Jews vexed Christians. But within hypocrites nefariously twisted the Holy Apostles’ doctrine concerning justification by faith without works unto licentiousness. The Apostle thought that each was to be met, the former with saving consolations, the latter with correction of their depraved opinion, as if an external profession of faith were abundantly sufficient for salvation, and it were lawful to indulge the remaining sinful appetites, and to live life wickedly.