Demanding people being pure and good, denying their egoistical sides can lead to quite terrible outcomes. The art is to deal with these character sides as well.
I don't have a huge group of friends but all of them have flaws like me. If you can forgive yourself, people start to believe that you can forgive others too and maybe you would make friends. Generally people that only point the finger at the smallest flaws are called self-righteous for a reason. And no, they often do not have many friends.