The therapist, the priest, the penpal, the stranger on a train. We always need some confessor who isn’t among our friends. Why? Because in order to respect our friends, we must believe that they will disapprove of some things — particularly, that they share something of our own set of morals. So when you’ve done something shameful, there’s no hope in telling your friends. Either they’ll lose respect for you, or (worse?) they’ll accept your failure, and so you’ll lose respect for them.
Just as Groucho wouldn’t join a club that would have him as a member, so — beyond a certain threshold of self-hatred — you can’t befriend somebody who would have you as a friend.
Here’s the role for the expendable not-quite friend, whatever medical, spiritual or social guise s/he may take. Here also is another reason why religions and mores usually have some system of penance and forgiveness — not just for patching up broken relationships, but because the /possibility/ of repair allows for openness.