Well, you certainly should not change your morality or personality for someone else. Definitely not worth bringing more negativity in your life. It seems you've told him what you think, but he doesn't really care enough to stop. So the foundation of the friendship is weak.
In the end, it's up to you. You can always slowly disassociate yourself from him. This is what I did with my old friend from school. I was in a similar situation to you. He socialised with bad people, and he became worse and worse. It also felt to me like he kept me around because he couldn't handle being alone. It was a bad friendship, so I just responded to him less and less, and then the "friendship" withered away on its own.