I think Joey is a good friend, but a couple of counter points, or examples of when he really messed up as a friend.
He lost Ross' wedding ring. He cut open Chandler's bedroom door. He got their furniture stolen. He dated Ursula when it clearly bothered Phoebe, including bailing on Phoebe's birthday party to be with Ursula. He and Chandler left Ben on a city bus. I honestly think he over-punished Chandler for kissing Kathy, who was a girl he had been dating non-exclusively for a few weeks, and Chandler ended up kissing her when Joey bailed on a date to be with another woman. He let Rachel into the wedding when he was supposed to be looking out for her because he was making out with someone. He kicks Chandler out of the cab on the middle of a busy bridge because he is skeptical about an acting gig, when Chandler has always been so supportive of him. Then he lies about his movie to make Chandler feel worse. He got Monica and Chandler's door broken down and then lied to cover it up. He dates Rachel. I know they make a point of acting like it had been so long since Ross and Rachel dated (5 or 6 years at that point), but they had gotten married and had a child together pretty recently. And Joey knew that Ross had been interested in getting back together with Rachel after Emma was born.
Basically, I think it is hard to pick the best friend because they all had their moments of screwing up because people screw up, and also TV shows need conflict. I think most people would probably pick the character that would be the best friend for them, personally. Honestly, I think Ross is the best friend, but that is probably because I am a nerd and I think all the scienc-y stuff he is always getting ridiculed for is really interesting. I also think he is consistently stable and helpful. He has a way of always coming around to doing the right thing, even when it doesn't come naturally to him.