I believe the fuller quote is important:
*James 2:21 Was not Abraham our father justified by works, when he had offered Isaac his son upon the altar?
22 Seest thou how faith wrought with his works, and by works was faith made perfect?
23 And the scripture was fulfilled which saith, Abraham believed God, and it was imputed unto him for righteousness: and he was called the Friend of God.
24 Ye see then how that by works a man is justified, and not by faith only.
25 Likewise also was not Rahab the harlot justified by works, when she had received the messengers, and had sent them out another way?
26 For as the body without the spirit is dead, so faith without works is dead also.*
As a Protestant, who believes in the historic doctrine of sola fide, I believe that my fellow Protestants often twist themselves in exegetical knots trying to make James only speak of the “evidence” of justification. While the passage does speak of works as providing evidence of faith, it seems clear to me that he is giving works a substantive role in “justification” itself. James makes clear that works “justify” inasmuch as without them faith is a dead and useless instrument for the purpose of justification. Paul says the same, “faith which worketh (or, “is effectual”) by love” Galatians 5:6.
Paul makes clear that faith alone is the instrument by which we stand justified before God. However, this faith is necessarily and always accompanied by love/good works. Luther himself notes the following on Galatians 5:6 in his Commentary on Galatians:
Galatians 5:6 For in Jesus Christ neither circumcision availeth any thing, nor uncircumcision, but faith which worketh by love.
Faith must of course be sincere. It must be a faith that performs good works through love. If faith lacks love it is not true faith. Thus the Apostle bars the way of hypocrites to the kingdom of Christ on all sides. He declares on the one hand, “In Christ Jesus circumcision availeth nothing,” i.e., works avail nothing, but faith alone, and that without any merit whatever, avails before God. On the other hand, the Apostle declares that without fruits faith serves no purpose. To think, “If faith justifies without works, let us work nothing,” is to despise the grace of God. Idle faith is not justifying faith.
studylight.org/commentaries/mlg/galatians-5.html
The traditional Anglican treatment on Justification by Faith Alone (Book of Homilies I, Homily on Justification) likewise notes how after justification, living contrary to Christ causes apostasy from our salvation in Christ:
“Our office is not to pass the time of this present life unfruitfully and idly after we are baptized or justified, not caring how few good works we do to the glory of God and profit of our neighbors. Much less is it our office, after that we be once made Christ’s members,
to live contrary to the same, making our selves members of the devil, walking after his incitements, and after the suggestions of the world and the flesh, whereby we know that we do serve the world and the devil, and not GOD.”
anglicanlibrary.org/homilies/bk1hom03.htm
Or, as the Anglican reformer Latimer affirms the necessity of the justified walking in obedience vs. disobedience:
"I put the case, Joseph had not resisted the temptations of his master’s wife, but had followed her, and fulfilled the act of lechery with her ; had weighed the matter after a worldly fashion, thinking, “I have my mistress’s favour already, and so by that mean I shall have my master’s favour too ; nobody knowing of it.”…And that man or woman that committeth such an act, loseth the Holy Ghost and the remission of sins ; and so becometh the child of the devil, being before the child of God. For a regenerate man or woman, that believeth, ought to have dominion over sin ; but as soon as sin hath rule over him, he is gone: for she leadeth him to delectation of it, and from delectation to consenting, and so from consenting to the act itself. Now he that is led so with sin, he is in the state of damnation, and sinneth damnably. And so ye may perceive which be they that sin deadly, and what is the deadly sin; namely, that he sinneth deadly that wittingly falleth in sin: therefore it is a perilous thing to be in such an estate, to be in the state of damnation and everlasting perdition.”[THE SIXTH SERMON, PREACHED ON THE FIRST SUNDAY IN ADVENT, 1552, BY MASTER HUGH LATIMER]
Luther likewise states:
“29. Therefore, saints must, by a vigorous and unceasing warfare, subdue their sinful lusts if they would not lose God’s grace and their faith. Paul says in Romans 8, 13: “If ye live after the flesh, ye must die; but if by the Spirit ye put to death the deeds of the body, ye shall live.” In order, then, to retain the Spirit and the incipient divine life, the Christian must contend against himself.”
orlutheran.com/html/mlseco31.html
Luther unfortunately embraced a popular scholarly opinion of the day shared by his primary Catholic opponent, Cardinal Cajetan–namely that James was not a fully canonical book. Consequently, he allowed his dislike of James’ terminology to obscure the substantive agreement he had with the teaching of the Book of James.