The Rambam (Hilchot Rotze'ach 4:9) discusses this. After discussing a unique law applied to murderers, he writes:
ואין עושין דבר זה לשאר מחוייבי מיתות בית דין--אלא אם נתחייב מיתה,
ממיתין אותו; ואם אינו חייב מיתה, פוטרין אותו: שאף על פי שיש עוונות
חמורין משפיכות דמים, אין בהן השחתת יישובו של עולם כשפיכות דמים. אפילו
עבודה זרה, ואין צריך לומר עריות או חילול שבת--אינן כשפיכות דמים:
שאלו העוונות הן מעבירות שבין אדם להקדוש ברוך הוא, אבל שפיכות דמים
מעבירות שבינו לבין חברו. וכל מי שיש בידו עוון זה, הרי הוא רשע גמור;
ואין כל המצוות שעשה כל ימיו שקולין כנגד עוון זה, ולא יצילו אותו מן
הדין--שנאמר "אדם, עשוק בדם נפש . . ." (משלי כח,יז).
צא ולמד מאחאב עובד עבודה זרה, שהרי נאמר בו "רק, לא היה כאחאב" (מלכים
א כא,כה); וכשנסדרו עוונותיו וזכייותיו לפני אלוהי הרוחות, לא נמצא לו
עוון שחייבו כליה ולא היה שם דבר אחר ששקול כנגדו אלא דמי נבות: שנאמר
"ותצא הרוח, ותעמוד לפני ה'" (ראה מלכים א כב,כא; דברי הימים ב יח,כ), זו
רוח נבות; ונאמר לה "תפתה וגם תוכל" (מלכים א כב,כב; דברי הימים ב
יח,כא). והרי הוא הרשע לא הרג בידו, אלא סיבב; קל וחומר להורג בידו.
In English:
This measure is not taken with regard to other crimes punishable by
execution by the court. If a defendant is liable for execution, he
should be executed. If he is not liable for execution, he should be
released.
Although there are other sins that are more serious than murder, they
do not present as serious a danger to society as murder does. Even
idol worship - and needless to say, incest or the violation of the
Sabbath - are not considered as severe as murder. For these sins
involve man's relationship with God, while murder also involves man's
relationship with his fellow man.
Whoever commits this sin is an utterly wicked person. All the mitzvot
that he performs throughout his lifetime cannot outweigh this sin and
save him from judgment. Thus, Proverbs 28:17 states: "A man weighed
down with life's blood will flee to the pit."
Come and learn from the example of Ach'av King of Israel. He was an
idolater so debased in his paganism that I Kings 21:25 says: "There
was none like Ach'av who gave himself over to the performance of
wickedness in the eyes of God." And yet when his merits and sins were
weighed in the presence of the Lord of spirits, there was no sin that
warranted his destruction and was not counterbalanced by a positive
quality, except the blood of Navot.