Quien con lobos anda, a aullar se enseņa.

I think an equivalence in English is "If you lie down with dogs, you'll get up with fleas." The meaning is the same: if you associate with disreputable characters are inevitably harmed by the connection.