Ephesians 2 does not teach “sola fide.” Paul is saying that works do not merit the initial grace of justification. He does not say that works have no bearing on salvation or that we will not be judged according to our works. To the contrary, Paul teaches that works do merit salvation subsequently.
What is granted in accordance with a fair judgment, would seem a condign reward. But life everlasting is granted by God, in accordance with the judgment of justice, according to 2 Timothy 4:8: “As to the rest, there is laid up for me a crown of justice, which the Lord, the just judge, will render to me in that day.” Therefore man merits everlasting life condignly.
newadvent.org/summa/2114.htm#article3
And Paul speaks of the judgment in Romans.
But according to thy hardness and impenitent heart, thou treasurest up to thyself wrath, against the day of wrath, and revelation of the just judgment of God. Who will render to every man according to his works. To them indeed, who according to patience in good work, seek glory and honour and incorruption, eternal life: But to them that are contentious, and who obey not the truth, but give credit to iniquity, wrath and indignation. Tribulation and anguish upon every soul of man that worketh evil, of the Jew first, and also of the Greek. But glory, and honour, and peace to every one that worketh good, to the Jew first, and also to the Greek. For there is no respect of persons with God. (Romans 2:5-11)
And Paul says that those who commit mortal sins will be damned.
I say then, walk in the spirit, and you shall not fulfil the lusts of the flesh. For the flesh lusteth against the spirit: and the spirit against the flesh; for these are contrary one to another: so that you do not the things that you would. But if you are led by the spirit, you are not under the law. Now the works of the flesh are manifest, which are fornication, uncleanness, immodesty, luxury, Idolatry, witchcrafts, enmities, contentions, emulations, wraths, quarrels, dissensions, sects, Envies, murders, drunkenness, revellings, and such like. Of the which I foretell you, as I have foretold to you, that they who do such things shall not obtain the kingdom of God. But the fruit of the Spirit is, charity, joy, peace, patience, benignity, goodness, longanimity, Mildness, faith, modesty, continency, chastity. Against such there is no law. And they that are Christ’s, have crucified their flesh, with the vices and concupiscences. (Galatians 5:16-24)
Furthermore, saying that salvation is by faith, not works is nonsensical because properly speaking faith is a work. Christ says to the Jews,
This is the work of God, that ye believe on him whom he hath sent (John 6:29).
It is not true that bad works means there was no faith to begin with. It is possible to have faith and be damned because we do not follow through on it, for which reason Paul says,
If I should have all faith, so that I could remove mountains, and have not charity, I am nothing (1 Cor. 13:2).
So it is baffling that Dr. Luther could say in opposition to Scripture that “although sin in the flesh has not yet been altogether removed or become dead, yet He will not punish or remember it” (Smalcald Articles iii.13) when it is evident that God will judge and punish or reward everyone on the basis of their works.