The modern phrase faith alone has drifted a long way from what Luther asserted, and the drift runs in two directions at once.
First, justification is forensic. It is a verdict, a declaration that a person stands righteous before God, pronounced on the ground of what Christ did rather than of anything in the person. Luther's image is imputation: the righteousness is Christ's and is reckoned to the believer, who remains in himself a sinner. His formula was simul iustus et peccator, at once righteous and a sinner. This is a legal category and it is deliberately distinguished from the moral change that follows, which the Reformers called sanctification and which is real, progressive and never complete in this life. Catholic theology does not make the separation: for Trent, justification is a translation from one state to another in which grace actually makes the person righteous, so that the declaration and the transformation are one act.
Second, faith is trust, not assent to propositions and not a mental act performed as a condition. Luther described it as a living, busy, active thing, and insisted that it cannot fail to produce works any more than fire can fail to produce heat. His notorious addition of the word alone to his German rendering of Paul's sentence in Romans was defended on the ground that the sense required it, and his commentary on James, which says a man is justified by works and not by faith alone, was to call that letter an epistle of straw, a judgement later Lutheranism did not follow.
Works, on this account, are necessary as fruit and useless as ground. Nobody in the sixteenth-century argument held that a Christian may live as he likes; the question was whether what a person does contributes to the verdict, and Luther said it does not.