The Gemara Bava Basra 4A seems to indirectly answer that question
וּבָבָא בַּר בּוּטָא הֵיכִי עֲבַד הָכִי וְהָאָמַר רַב יְהוּדָה אָמַר רַב וְאִיתֵּימָא רַבִּי יְהוֹשֻׁעַ בֶּן לֵוִי מִפְּנֵי מָה נֶעֱנַשׁ דָּנִיֵּאל מִפְּנֵי שֶׁהִשִּׂיא עֵצָה
And how did Bava ben Buta do this (give advice to Herod the wicked?) Rav Yehuda say that Rav says, and some say it was Rabbi Yehoshua ben Levi who says: For what reason was Daniel punished? Because he offered advice to Nebuchadnezzar (to give Tzedoka and save himself)etc
The Gemara answers
אִיבָּעֵית אֵימָא שָׁאנֵי עַבְדָּא דְּאִיחַיַּיב בְּמִצְוֹת וְאִיבָּעֵית אֵימָא שָׁאנֵי בֵּית
הַמִּקְדָּשׁ דְּאִי לָא מַלְכוּת לָא מִתְבְּנֵי
If you want, say that a slave (like Herod) is different since he is obligated in the mitzvos, (so therefore Bava ben Buta helped him repent). And if you want, say the Beis Hamkdush is different, as without the help of the government it would not have been built.
The answer of the Gemara as why Bava Ben Buta was allowed to give Herod such advice would also answer why they allowed him to do it