In prioritizing the law, how does a person honor his parents if his parents are law-breakers? For example, if a man's father is a murderer, would the man choose to dishonor his father by handing him over for punishment, or ignore the law regarding murder to honor his father? Does punishing the murderer take priority, or honoring the father? Which laws would take priority over honoring one's parent? For instance, would the prioritization change if the parent is an adulterer, or a thief, or an idolater?
Does the commandment to honor parents take precedence over other commandments? The Talmud answers: Not always:
Eleazar ben Mathia said: If my father orders me, “Give me a drink of water”, while I have a commandment to perform, I disregard my father's honor and perform the commandment… [But] Issi ben Yehudah maintained: If the commandment can be performed by others, it should be performed by others, while he should bestir himself for his father's honor. Said Rabbi Mattena: The law agrees with Issi ben Yehudah. [Kiddushin 32a]
While any specific case may have some minor details that warrant different responses (as per just about every facet of life and Halacha), it seems that the general approach given by the authorities is that regardless of the righteousness of the parent, some level of respect needs to be given 1. However, if honoring a parent would cause the child to go against some other religious obligation (even a Rabbinic one), the child is forbidden from performing that 'honor'2 (of course, the child should still go about his duties in the most respectful way possible, but if push comes to shove and the choice is either honor the father or fulfil a commandment/avoid a transgression, the commandment wins out. But practically, one can usually still maintain some level of respect with a parent while still maintaining his or her religious obligations).
1: See Kitzur Shulchan Aruch 143:9 who writes that even a wicked parent needs to be honored, or at least not degraded.
אֲפִלּוּ אָבִיו רָשָׁע וּבַעַל עֲבֵרוֹת, מְכַבְּדוֹ וּמִתְיָרֵא מִמֶּנוּ. וַאֲפִלּוּ מַמְזֵר, חַיָב בִּכְבוֹד אָבִיו וּמוֹרָאוֹ. וְיֵשׁ אוֹמְרִים, דְאֵינוֹ מְחֻיָב לְכַבֵּד אָבִיו רָשָׁע כָּל זְמַן שֶׁלֹּא עָשָׂה תְּשׁוּבָה. וְאַךְ לְצַעֲרוֹ, אָסוּר. וְיֵשׁ לְהַחְמִיר כַּסְּבָרָה הָראשוֹנָה. Even if your father is wicked and a sinner you must honor and fear him.6 Even a bastard is obligated to honor and fear his father. Others say7 you need not honor your father, if he is wicked, so long as he did not repent, but you are forbidden to cause him grief. You should be stringent and follow the first opinion.
2: Kitzur Shulchan Aruch 143:11 explains that the honor given to a parent does not supersede the religious obligations of the child.
אָמַר לוֹ אָבִיו לַעֲבֹר עַל דִּבְרֵי תוֹרָה, בֵּין עַל מִצְוַת עֲשֵׂה בֵּין עַל מִצְוַת לֹא תַעֲשֶׂה, אֲפִלּוּ עַל מִצְוָה שֶל דִּבְרֵיהֶם, לֹא יִשְׁמַע לוֹ, דִּכְתִיב, אִישׁ אִמּוֹ וְאָבִיו תִּירָאוֹ וְאֶת שַׁבְּתוֹתַי תִּשְׁמֹרוּ אֲנִי ה' אֱלֹהֵיכֶם, סָמַךְ שַׁבָּת לְמוֹרָא אָב וָאֵם, לוֹמַר, אַף עַל פִּי שֶׁהִזְהַרְתִּיךָ עַל מוֹרָא אָב וָאֵם, אִם אָמַר לְךָ חַלֵּל אֶת הַשַׁבָּת, אַל תִּשְׁמַע לוֹ. וְכֵן בִּשְׁאָר כָּל הַמִצְוֹת. אֲנִי ה' אֱלֹהֵיכֶם, אַתָּה וְאָבִיךָ חַיָבִים בִּכְבוֹדִי. לְפִיכָךְ לֹא תִשְׁמַע לוֹ לְבַטֵּל אֶת דְּבָרָי. וְגַם מִצְוֹת דְּרַבָּנָן, דִּבְרֵי הַשֵׁם יִתְבָּרַךְ שְׁמוֹ הֵן, דִּכְתִיב, לֹא תָסוּר וְגוֹ'. אָמַר לוֹ אָבִיו, שֶׁלֹּא יְדַבֵּר עִם פְּלוֹנִי וְשֶׁלֹּא יִמְחוֹל לוֹ, וְהַבֵּן הָיָה רוֹצֶה לְהִתְפַּיֵס, אֵין לוֹ לָחוּשׁ לִפְקֻדַּת אָבִיו, כִּי אָסוּר לִשְׂנֹא שׁוּם יְהוּדִי אִם לֹא כְּשֶׁרוֹאֵהוּ שֶהוּא עוֹבֵר עֲבֵרָה, וְנִמְצָא שֶהָאָב צִוָּהוּ לַעֲבוֹר עַל דִבְרֵי תוֹרָה. If your father told you to transgress a Scriptural Law whether it be a positive or negative command or even a Rabbinical injunction, you must not obey him, for it is written, "Every man shall revere his mother and father and you shall preserve My Shabbos, I am Adonoy your God."8 Shabbos is positioned in the same verse [that instructs you to fear] your father and mother to teach: "Even though I command you to fear your father and mother, if your parent tells you to desecrate the Shabbos you must not listen to him. This is true for all the mitzvos. [For] I am Adonoy your God. Both you and your father are bound to honor Me. You must therefore not listen to him to disregard My word." Rabbinical injunctions are also the commands of Hashem, Blessed be His Name, as it is written, "You shall not turn aside," etc. If your father told you not to speak to a certain person, and not to forgive him; but you would like to be reconciled; you should not be concerned with your father's order, as you are forbidden to hate any Jew unless you see him commit a sin. Thus your father has ordered you to transgress a law of the Torah.
All commentators I am aware of say that you honor your parents no matter what.
The Talmud says that parents who sin may be rebuked, but very gently:
Rabbi Eliezer was asked: “How far does the honor of parents [extend]”? If your father is transgressing a precept of the Torah, you must not say to him, “Father, you are transgressing a precept of the Torah”, but... “Father, such and such a verse is written in the Torah.” [Kiddushin 32a]
You must also look for your parents’ qualities and achievements. Rav Chaim Shmuelevitz says:
True fulfillment of honoring parents is only possible if you feel real respect and admiration toward them. You must therefore find areas or character traits in which they excel. If you do not cultivate a deep feeling of esteem for them, even if you go through all external motions of acting respectfully, you have not fulfilled the Torah’s goal at all. [Sichot Mussar, p 158]
Rabbi Meir Simcha of Dvinsk, from 19th-century Eastern Europe, writes:
Even if your father and mother abandoned you and did not raise you, you should still honor them “as the Lord your God has commanded you.” [Meshech Chochma on Deut. 5:16]
Why? For several reasons. They transmitted the Tradition to us. Even if not, they transmitted the knowledge that we are Jewish, thereby giving us the impetus to discover the Tradition on our own, knowing that we belong. And even if not, they gave us life: That alone is sufficient reason.
If this is not crystal-clear, relax, you are not alone. In Tanhuma, Rabbi Shim'on bar Yochai concludes:
The most difficult of all mitzvot is “Honor your father and your mother”. [Tanhuma, Ekev 2]