Of course, we hold friends for all these reasons and more.
(1) We as humans naturally flock to people who have similar thoughts and opinions to us. This is a natural thing, because by spending time with people we respect and agree with, there will be a lighter atmosphere and more can be accomplished.
On the other hand, spending time with people we disagree with can often lead to strife, disagreements, and awkward moments. Why then do most of us have at least one friend that has differing views from our own? I think the most likely explanation for this is that the other factors of friendship can overpower differing views. Furthermore, there can be a positive side. By spending time with people we trust and respect, but who have different views than ours, it will be easier to understand those opinions, and possibly even incorporate some of their tenets, thereby expanding our scope.
The reason we spend time with people we agree with is so that they will support our thoughts and ideas, and make us feel better about ourselves. Also, we support our friends, so there exists a happy reciprocity.
(2) Almost all of us feel it, and in fact it can lead to problems, in particular for the younger generations. The desire/need to be socially recognized and accepted.
For most humans, an aspect of our personality is to spread our influence amongst society. I find it similar in a way how animals have the need to spread their genealogical traits amongst the species, but instead of physical characteristics, we have the desire to spread the things of our own creation, and other things that we think other people should know about.
This desire to be known and respected is an impetus to make friends. When we have friends and acquaintances, we can spread our social influence better.
(3) By having friends, we have a confidant that we can bounce ideas off of, and gain more understanding. By combining ideas, we can reach better ideas with more influence and power, and more possibility for personal gain. Also, just hearing your friends ideas, and having them share their knowledge with you can make you a smarter, more well-rounded person.
Friends serve another purpose by providing a way to check if your ideas are rational or not. Having a friend tell you a flaw in your thinking can be less hurtful than having a large group of peers sneer at you.
(4) A friend is someone who wished the best for you, and help you out when you are in need of assistance. For this reason, the more friends you have, the better. Maybe even better than having a plethora of friends is having a couple of very close friends, who are like family to you. These people you can hold near and dear to yourself your entire life, and they will be there to guide you, and to help you to be successful. And you will do the same.
Now, to quickly expand on this quote I put in this post. There has to be reciprocity in a friendship. A friendship where only one person is benefiting if doomed to either fail, or to a fate of nothing more than casual acquaintanceship. By being a friendly person, more people will be drawn to you, and you will have more opportunities for friendships. You also need to be a good friend to the friends you have, or, first of all, you will lose those friends, and second of all, you will decrease chanced for future friends.