We tend to gather in cliques and befriend those from whom we believe we can have gain. The Bible does tell us to seek out the wise so that we can be wise (Proverbs 13:20). There is nothing wrong with spending time with friends and people we enjoy being with—unless we treat those who we have little to do with poorly or as though they are not worthy of our time. Then we are wrong and in danger.
Jesus explained that we are to be like our Father in heaven, and that He makes the sun to shine on the good and the evil. He makes the rain fall on the just and the unjust (Matthew 5:45-48). If we love those who love us and greet only them, we are far from the attitude God seeks. Just as God loves the world and gave His Son for all (John 3:16), so we too need to consider everyone we come in contact with as a potential son of God. That does not mean we will not have enemies or people we need to avoid, but it does show us that our attitudes count heavily in our behavior toward our fellow man. We should be striving to become like God.