"And empty men gathered themselves to Jephthah" (Judges 11:3). From where do we know this matter that people say: "A bad palm tree goes and attaches itself to a thicket of barren trees" [like draws to like]? This matter is written in the Torah, repeated in the Prophets, stated a third time in the Writings, taught in our Mishnah, and taught in a baraita. It is written in the Torah: "And Esau went to Ishmael" (Genesis 28:9). Repeated in the Prophets: "And empty men gathered themselves to Jephthah" (Judges 11:3). Stated a third time in the Writings: "Every bird dwells according to its kind, and a man according to his like" (Ben Sira). Taught in our Mishnah: that which is attached to the impure is impure, and to the pure is pure. And taught in a baraita: Rabbi Eliezer says, not for nothing did the starling go to the raven, but because it is its own kind.
Empty Men Flock Together and the Proverb Found in All Three
Yalkut Shimoni on Nach 67:1
ויתלקטו אל יפתח אנשים ריקים. מנא הא מילתא דאמרי אינשי מטייל ואזיל דקלא בישא לגבי קינא דשרכי דבר זה כתוב בתורה ושנוי בנביאים ומשולש בכתובים תנינן במתניתין ותנינן בברייתא. כתוב בתורה וילך עשו אל ישמעאל. שנוי בנביאים ויתלקטו אל יפתח אנשים ריקים. משולש בכתובים כל עוף למינו ישכון ובן אדם לדומה לו. תנינן במתניתין המחובר לטמא טמא לטהור טהור. ותנינן בברייתא רבי אליעזר אומר לא לחנם הלך זרזיר אצל עורב אלא מפני שהוא מינו: