In Romans chapter 1 Paul demonstrated the deplorable state of mankind. His thought continued with this:
Romans 2:1-5 (KJV)
Therefore thou art inexcusable, O man, whosoever thou art that judgest: for wherein thou judgest another, thou condemnest thyself; for thou that judgest doest the same things.
But we are sure that the judgment of God is according to truth against them which commit such things.
And thinkest thou this, O man, that judgest them which do such things, and doest the same, that thou shalt escape the judgment of God?
Or despisest thou the riches of his goodness and forbearance and longsuffering; not knowing that the goodness of God leadeth thee to repentance?
But after thy hardness and impenitent heart treasurest up unto thyself wrath against the day of wrath and revelation of the righteous judgment of God;
With the beginning of this chapter Paul changed over to a discussion addressed to "man." Prior to this, the discussion encompassed the totality of humankind, but here he began a section about a particular group of people. These are people who understand the sinfulness of the actions in chapter 1 and judge those who commit these sins. However, Paul said that they were inexcusable because in their judgment of those committing the before mentioned sins, they condemned themselves because they did, perhaps not the exact sins, but ones that were just as bad (verse 1).
Many in Christianity have used verses like these to justify the belief that judging sin is wrong and is condemned by Paul. But this was not what Paul was saying. We are to judge what is right and wrong according to God's Word. Paul was doing exactly that in chapter 1, but in the judging of sin we are not allowed to somehow think that we are above or better than another sinner. Paul's point of chapter 1 showed that all of mankind is sinful. We must recognize that this includes each one of us.
In verse 2 Paul stated his assurance that God judges the sinner accurately according to reality rather than just the outward appearance on which humans base their judgments. Often some are held to high esteem because of notoriety, wealth, position, or apparent godliness and others are condemned to the highest degree who may be no more guilty than the esteemed. Also, although these judges know themselves as wretches, they make excuses, minimize the seriousness of their sin, and believe that they are better than others. They seem to feel that God will make the same excuses for them, but God will not (verse 3).
In verse 4 Paul spoke about the goodness, forbearance, and longsuffering of God and how the goodness of God should lead to repentance. Instead, these judges are hard of heart and don't repent, which stores up God's wrath against them and one day will result in the righteous judgment of God against sinners (verse 5).
We need to be truthful with ourselves and recognize our sinfulness. Sin doesn't belong only to those around us. All of mankind is in need of a Savior.