James was dealing with a specific problem that was taking place in Jerusalem.edit
He also wants to bring up the same topic/proof-text that has been refuted 50 million times in the past.
James 2:24 doesn't deny salvation by faith alone.
It denies "justification" by faith alone.
And specifically what it is saying that just because someone CLAIMS to have faith, doesn't mean they actually do. Their subsequent works JUSTIFY their claims of having faith.
James 2:14 What good is it, my brothers, if someone says he has faith but does not have works? Can that faith save him?
Jewish believers were being persecuted by unregenerate religious Jews. Some believers were being boycotted and their businesses were going broke. So, when James said.... "
What good is it, my brothers and sisters, if someone claims to have faith but has no deeds?
Can such faith save them? Suppose a brother or a sister is without clothes and daily food.
If one of you says to them, “Go in peace; keep warm and well fed,” but does nothing
about their physical needs, what good is it? In the same way, faith by itself, if it is not
accompanied by action, is dead."
James was telling them to stop using their faith as one waving a magic wand over someone. That real faith requires action to correct a problem. Their faith (in this case, used as wishful thinking) was using faith that was not justified.