It ABSOLUTELY matters!!!!! In answer to your questions...
1. Children are like sponges, they pick up stuff from everyone. I think as children mature, they can be come resilient against the negative influence of other kids. But they have to be VERY confident in themselves and committed to doing the right thing. And even the most strong child can cave if surrounded by temptation. My family is from Michigan, we moved to Kentucky when I was 12 and my brother 10. We were home schooled for elementary school and went to a boarding school sponsored by our church for high school. My brother decided he wanted to attend public high school for his Jr. and Sr. year. He is the only one in our family with a Kentucky accent. He wanted to fit in SO BAD he permanently changed the way he talked. People can instantly tell if you were "born there" and we were considered "foreigners" because we were from up north. I think my brother was able to disguise that fact completely.
2. Yes and no. There is wisdom in a multitude of counselors. And not that you canvas everyone you meet. But a multitude of people you trust. I'll use addiction as an example. Someone who struggles needs to surround themselves with people who are not addicts, can encourage them to do the right thing and not enable them to continue in addiction. However, they also need support from those who have been there, because that type of accountability (say in a AA meeting) is more helpful then from people who have never had a problem. It would not be helpful to hang around a bunch of addicts who were not trying to overcome this. My question about the person who is "still dealing with the same issues" is this: Do they want to have victory or freedom from it, and are they pursuing it and changing their life so they are not surrounded by temptation? Will their influence uplift you or drag you down?
3. Absolutely. I do not confine my group of friends to be of the same Christian denomination, however most of them are. We understand where we are coming from, and encourage each other to make the right choices. Especially when it comes to our marriages and child raising. I have friends who I love dearly, but would NEVER ask advise from or share personal struggles with because we do not share the same values. I love them because of our history/relationship, but they are not confidants. Without the same world view, how can you have more than a casual acquaintance?
4. It does matter. I limit the time my children spend with some friends who are not behaving appropriately. I understand some parents have a harder battle with strong willed children. But if I don't see that the parent realizes and is seeking to correct this behavior, then I am leery of letting my child spend lots of time with their child. My daughter (4.5) picks up so many things from other children already and she is not in pre-school or day care. People you are friends with will affect your thinking and world view/values/morals. It is impossible to override that. So surround yourself with the people you want to become like.
I know this is a really delicate topic. And if you choose to leave certain friends behind, or limit contact, it will be hard to do and painful for them. However you ultimately are the one responsible for how your children are raised.