Be ye not unequally yoked together with unbelievers: for what fellowship (in common) hath righteousness with unrighteousness? and what communion hath light with darkness – 2nd Corinthians 6:14.
The caution itself, not to mingle with unbelievers, not to be unequally yoked with them, was inspired by God to the Apostle Paul. It is wrong for good people to join in affinity with the wicked and profane. There is more danger that the bad will damage the good than hope that the goodwill benefits the bad.