In The Name of Allaah, The Most Merciful, The Bestower of Mercy.
Imaam Barbahaaree [rahimahullaah] said, “He who loves the deeds of a people, good or bad, is just like the one who commits them”.
Shaikh Saaleh Al-Fawzaan- may Allaah preserve him- commented on the above statement of Imaam Al-Barbahaaree [rahimahullaah] as follows: He who loves the deeds of a people is just like one who commits them; so if those (deeds) are good he gets a reward similar to theirs, and if those (deeds) are bad he bears the burden and sin similar to theirs. We seek Allaah’s refuge from that!
And due to this, it has been reported concerning the one that wishes to be like the scholar who teaches the people good, that he will get a reward similar to that of (that Scholar). And the one that wishes to be like the rich person who spends his wealth in the path of Allah, (then) he will receive a reward similar to that of (that rich person) in accordance with his intention.
Likewise, the opposite of this is (with regards) to the one who wishes to be like the criminal and the people of sin, (and) wishes to be their partners in sin or give support to their views and hold it to be true, (then) he is like them even if he did not commit an act similar to theirs, (but) solely (due to the fact that) he held their views to be correct and took their side. [Source: It-haaful Qaaree Bitta’liqaat Alaa Sharhis Sunnah Lil Imaam Barbahaaree’ Vol: 2. page 113-114]