Condemnation. See not on v. 16. One act of righteousness. Not a reference to a single event, but generally to Christ’s obedience (cf. v. 19; Luke 2:49; John 4:34; 5:30; 6:38), culminating in the greatest demonstration of this obedience, death on a cross (Phil. 2:8). Justification . . . for all men. This cannot mean that all men will be saved; salvation is only for those who exercise faith in Jesus Christ (cf. Rom 1:16-17; 3:22, 28; 4:5, 13). Rather, like the word many in 5:15, Paul is using “all” with two different meanings for the sake of parallelism, a common practice in the Hebrew OT.
The Reformation ESV Study Bible explains: 
5:18, 19 Paul returns to the main thrust of his analogy, namely that there is a parallel between Adam and Christ in that condemnation and justification are the direct fruits of their actions. On the basis of the actions of “one,” “many” are constituted either sinners or righteous. Adam is the representative head as well as the physical root of all, and all sinned and fell when he sinned. In contrast, “by the one man’s obedience” those whom Christ represents are “made righteous” in Him. Christ is their representative Head, as well as the spiritual root of the new humanity, for through His resurrection they are given new birth and a living hope (1 Pet. 1:3; Eph 2:1-7)
John Gill in his Exposition of the Entire Bible:
Therefore as by the offence of one,.... Or by one offence, as before, the guilt of which is imputed to, and
[judgment came] upon all men to condemnation; which word is used in a legal sense, and intends condemnation to eternal death, as appears from the antithesis in the text; for if "justification of life", means an adjudging to eternal life, as it certainly does, the judgment or guilt, which is unto condemnation, must design a condemnation to eternal death, the just wages of sin: and this sentence of condemnation comes upon all men, all the sons of Adam without exception, even upon the elect of God themselves; though it is not executed upon them, but on their surety, whereby they are delivered from it:
even so by the righteousness of one, [the free gift] came upon all men to justification of life; the righteousness of Christ being freely imputed without works, as it is to all the men that belong to the second Adam, to all his seed and offspring, is their justification of life, or what adjudges and entitles them to eternal life. The sentence of justification was conceived in the mind of God from eternity, when his elect were ordained unto eternal life, on the foot of his Son's righteousness; this passed on Christ at his resurrection from the dead, and on all his people as considered in him, when they, in consequence of it, were quickened together with him; and this passes upon the conscience of a sinner at believing, when he may, as he should, reckon himself alive unto God, and is what gives him a right and title to everlasting life and glory.
What Charles H Spurgeon had to say about Romans 5:17-18:
All who are in Christ are justified by Christ, just as all who were in Adam were lost and condemned in Adam. The “alls” are not equal in extent —equal as far as the person goes in whom the “alls” were found. And this is our hope — that we, being in Christ are justified because of his righteousness.
This content is taken from this document