I think this could be an interesting discussion. I agree with you that we need to be careful to avoid "friendship" with non-Christians. I think it is more accurate to say that Christ showed compassion and a love for sinners than it is to say he shared a friendship. To me the word friendship implies a relationship of mutual appreciation and a sharing of some interests/values. Christ went to where the outcasts were gathering /congregating to reach them. While he was in their presence, he was evangelizing them; not partaking in their sins. I think he went out of his way to be in their company, obviously, to reach them and also to make a statement: that he had come to redeem all the lost. I think that was especially significant in the Jewish culture that focused on outward observance of the law. The sinners that Christ was "befriending" were being shunned by the religious society of the day. Contrary to many situations today, these sinners weren't popular or beloved. They were being shunned and would be considered undesirables. I think he was extending mercy to them publicly to show the true nature of the gospel. He was also able to be very gentle to these sinners, because they already knew the ramifications of their lifestyle. Tax collectors/harlots, etc weren't going to be the ones who were self-righteous. He had to be much stronger with his language when he confronted the religious leaders. I don't think we should attribute his gentleness with these sinners to his approval of their sins.
I think where this can get tricky is that as his disciples we are supposed to emulate Christ's behavior. I think we should be outreach focused and be willing to share the gospel with everyone (regardless of their sins/social positions, etc). That may require us at times to go into unpleasant situations or environments to have the opportunity to talk to others. The key though is that the Son of God was above temptation and was able to be around sinners without partaking in their sins. As Christians, we are not above temptation. We have to be very careful to avoid the deception that we are reaching others while we are actually being influenced/corrupted by them. So, I do agree with you that it's a very dangerous mindset to fall into: Christ was friends with sinners so I can be too. I also agree that the Pharisees said this about Christ in an attempt to discredit his ministry. Christ never referred to himself as the friend of sinners. He clearly stated that his mission was to redeem the lost sheep. That should be our focus as well.