People do this for many reasons, but I've learned there are two typical motivations:
1) Insecurity. They reason, "If I can push others down, then I come across as more successful/powerful/better as a person." The problem is this is false logic - exposing other people's flaws may take the spotlight off of yours for a moment, but it doesn't make your flaws disappear. Hence, the cycle continues.
2) Good intentions with bad application. They reason, "We should all be in a better place than we are, so I'll make sure others know what I think they need to be doing." The problem is this is more critical than constructive, but because it starts out with good intentions the person doing it may not see how he/she comes across. Hence, the cycle continues.
The only solution is to receive the genuine grace and genuine holiness of Jesus Christ - not one over the other, but both simultaneously. In this way you will experience unconditional love (so you can give it) and unconditional inspiration (so you can grow). Most of the time critics point out things in other people who haven't asked for it, but this approach makes you the kind of person others want to be like because they see Christ being formed in you - not just you whipping around good standards to impose on others.
This distinct difference can even be overlooked by regular church attenders, which is why we come across as hypocritical to the world. Christianity is surrender to Christ... not just trying to support His standards or be like Him. Many who call themselves Christians try to be what they think God wants them to be... BUT not as many (unfortunately) surrender their whole loves to God - they end up holding areas of their lives back from Him. By keeping that inner world from being transformed, they end up focusing on the "outer world" and try to look the part of a Christian while making sure others look the part, too.
There are a lot of people who are religious and can talk some good "Jesus talk" but haven't yet been born again and transformed. Their blind spot and hurdle is that they think they have.
Jesus often criticized the Pharisees for doing this in His culture. We may not have Pharisees around today, but we sure have those who just ask "What would Jesus do?" and do that alone... so they appear moral. But they don't ask, "God, what am I holding back from You, and how might I give that area over to You,. too? What action step do you want me to sacrificially take next?"
We all need accountability in this. Otherwise we try to be our own eye doctor... with blurry eyes.
No wonder so many of us walk around with "moral glasses" that we've self-prescribed - that only makes everything we see and point out blurry... only we think because we have the glasses on our sight is clearer than anyone else.
And then what happened? Well, when Israel tried to be right with God on her own, pursuing her own self-interest, she didn't succeed. The chosen ones of God were those who let God pursue his interest in them, and as a result received his stamp of legitimacy. The "self-interest Israel" became thick-skinned toward God. Moses and Isaiah both commented on this: Fed up with their quarrelsome, self-centered ways, God blurred their eyes and dulled their ears, Shut them in on themselves in a hall of mirrors, and they're there to this day. David was upset about the same thing: I hope they get sick eating self-serving meals, break a leg walking their self-serving ways. I hope they go blind staring in their mirrors, get ulcers from playing at god. (Romans 11:6-8, The Message)