The reason that works is necessary for salvation is because of this, and it has to do with love, for love is the fulfilling of the law.
1Co 13:13 And now abideth faith, hope, charity, these three; but the greatest of these is charity.
Charity, love in action, is greater than faith, and charity, love in action, is works that have to be done for love is greater than faith.
1Co 13:2 And though I have the gift of prophecy, and understand all mysteries, and all knowledge; and though I have all faith, so that I could remove mountains, and have not charity, I am nothing.
Paul said without charity then he is nothing.
1Ti 6:5 Perverse disputings of men of corrupt minds, and destitute of the truth, supposing that gain is godliness: from such withdraw thyself.
1Ti 6:6 But godliness with contentment is great gain.
1Ti 6:7 For we brought nothing into this world, and it is certain we can carry nothing out.
1Ti 6:8 And having food and raiment let us be therewith content.
1Ti 6:10 For the love of money is the root of all evil: which while some coveted after, they have erred from the faith, and pierced themselves through with many sorrows.
The love of money is the root of all evil, for it neglects the poor and needy, and they have erred from the faith.
Paul said without charity they have erred from the faith.
Jas 2:14 What doth it profit, my brethren, though a man say he hath faith, and have not works? can faith save him?
Jas 2:15 If a brother or sister be naked, and destitute of daily food,
Jas 2:16 And one of you say unto them, Depart in peace, be ye warmed and filled; notwithstanding ye give them not those things which are needful to the body; what doth it profit?
Jas 2:17 Even so faith, if it hath not works, is dead, being alone.
James is speaking of charity to help people with their needs if possible, and if they do not have charity then their faith is dead.
So Paul and James say the same thing that if a person does not have charity then they are lacking in faith.
1Jn 3:17 But whoso hath this world's good, and seeth his brother have need, and shutteth up his bowels of compassion from him, how dwelleth the love of God in him?
1Jn 3:18 My little children, let us not love in word, neither in tongue; but in deed and in truth.
John said without charity then the love of God does not dwell in them, so do not love in word only, but love in deed and in truth, charity, love in action, works of love.
That is why we have to have works for our salvation because it has to do with charity, love in action, works of love, and charity is greater than faith.
But someone might say if they are saved they will do the works, then why the lack of works among them, as they believe the prosperity Gospel, and love money and material things for their wants that neglects the poor and needy, and preachers that are millionaires preaching God blesses with money and material things which would be above their needs, which Paul said withdraw yourself from them.
Rev 3:14 And unto the angel of the church of the Laodiceans write; These things saith the Amen, the faithful and true witness, the beginning of the creation of God;
Rev 3:15 I know thy works, that thou art neither cold nor hot: I would thou wert cold or hot.
Rev 3:16 So then because thou art lukewarm, and neither cold nor hot, I will spue thee out of my mouth.
Rev 3:17 Because thou sayest, I am rich, and increased with goods, and have need of nothing; and knowest not that thou art wretched, and miserable, and poor, and blind, and naked.
And many people lack charity, works of love.
Works do save us for if you do not have those works of charity then you do not have love, and love is greater than faith, and love is the fulfilling of the law, and the Spirit does not force us to do works of love so it has to be initiated by us.
Like the Spirit will not lead anybody that does not hate sin, and does not want sin, and we are not forced to abstain from sins so it has to be initiated by us.
Rev 2:4 Nevertheless I have somewhat against thee, because thou hast left thy first love.
Rev 2:5 Remember therefore from whence thou art fallen, and repent, and do the first works; or else I will come unto thee quickly, and will remove thy candlestick out of his place, except thou repent.
Rev 3:1 And unto the angel of the church in Sardis write; These things saith he that hath the seven Spirits of God, and the seven stars; I know thy works, that thou hast a name that thou livest, and art dead.
Rev 3:2 Be watchful, and strengthen the things which remain, that are ready to die: for I have not found thy works perfect before God.
Rev 3:3 Remember therefore how thou hast received and heard, and hold fast, and repent. If therefore thou shalt not watch, I will come on thee as a thief, and thou shalt not know what hour I will come upon thee.
They say works have nothing to do with salvation but Jesus says something different.
Php 2:12 Wherefore, my beloved, as ye have always obeyed, not as in my presence only, but now much more in my absence, work out your own salvation with fear and trembling.
But of course we are saved by faith when we first confess Christ, but then we have to have works of love and to maintain our salvation.