The point Paul is making in 1 Corinthians 5:9-13 and 6:1-6 is that we as Christians need to start judging, so that when we get to heaven, we know how to do it.
To paraphrase:
"(Ch5.) Because you're not judging, you've started keeping company with perverts! I told you not to do that, don't even eat with them! Don't you jduge those outside the church? put away the evil person! (Ch6.) You've gone to the secular courts in order to settle disputes because you've apparently forgotten how to judge! Don't you know that we'll judge the world? You're not even equipped to do that, because you can't even judge the smallest matters! Don't you know that we'll judge the angels? Yet you can't even judge the things in this life, and rely on people outside the church to judge! Shame on you! Don't any of you know how to judge, just to judge among his brethren? But you've all gone to battle in court, and in secular court at that!"