The primary way we can tell which commandments are more important than others is by the punishment recorded in the Torah for various offences[1]. Thus, murder and adultery carry the death penalty; whereas eating on Yom Kippur "only" subjugates one to karet, heavenly excision.
The Torah prescribes that a clandestine thief, a ganav, must--in addition to retuning the amount stolen--pay a 100% fine, whereas a gazlan, one who brazenly steals, need only return the amount stolen with no fine assessed--making a ganav a more serious criminal than a gazlan[2]. This seems counterintuitive, as holding up someone at gunpoint would seem to be much worse than sneaking into their home and taking some jewelry. In a famous teaching, our Sages explained as follows: For all the evil of walking over to someone and demanding money, at least such a person is consistent. He fears neither G-d nor man. A ganav, on the other hand while he too has no fear of G-d is afraid of man (Bava Kama 79b). To display greater fear of man than G-d is criminal. To put it in modern parlance, it's better to be stabbed in the heart than in the back. The white collar criminal deserves greater punishment than the mugger.
Yet this is not the complete picture. "It was taught [in a Braita] Rav Elyai said: If a person sees that his [evil] inclination is becoming too powerful, he shall go to a place where people do not recognize him, and he shall dress in black and wrap himself in black, do what his heart desires, and not desecrate G-d's name in public" (Moed Katan 17a). Chilul Hashem, desecrating the name of G-d, is the one sin for which repentance is not possible in this world. Only upon death is atonement possible (Yoma 86a).
While it is to be hoped that changing clothes and travelling to another city will help control one's evil inclination enabling them to resist the urge to sin, our Sages understood that such was not always possible. Sometimes, people need to sin; and if such is the case, our Sages instruct us to do so in private and in a locale where we are unknown and thus, even if discovered, one's sin will have less impact on others. While modern communications may make anonymity highly unlikely, people must learn at times to turn a blind eye to those sinning in private.
Yet one can only turn a blind eye to sins between man and G-d. When harm is done to another human being, whether in public or private, one must fight for justice--even if, inevitably, a Chilul Hashem will be caused. The desecration of G-d's name caused by ignoring the injustice to another is much greater.
This concept was not invented by our Sages, and finds precedence in the Torah itself. Next week we will read about the eshet yefat toar, a beautiful ("enemy") woman whom one meets and is attracted to in wartime. The Torah could easily have instructed that we overcome and suppress our inclination to sin. However, knowing the superhuman strength required for this--especially in wartime--"the Torah spoke to our evil inclination" (Kiddushin 21b), and set up a series of procedures designed to help us overcome our desire. But if such do not work, the Torah allows one to have relations with such a woman. Rav Elayai took this concept one step further, "allowing" one to sin in cases even when the Torah says not to--in order to prevent even worse sinning.
Our Sages strove to find a proper balance between the ideal world and the world of reality. We may abhor sin, but sometimes we must--after all else has failed--allow one to sin, but instruct him to do so in the best possible way - in private. If one only allows for the ideal, those - and that is all of us - who cannot attain such might sin in a less desirable way.
This is not hypocrisy, but a method to limit the desecration of G-d's name. While we humans often look down on sinners, G-d is a kind, merciful, and understanding G-d, and is our "G-d before we sin and after we sin". And when one does sin, one can begin the process of teshuva--a process that, for sins between man and G-d, should remain that way. This is in contradistinction to sins between man and man, where we must publicize that our actions were wrong.
[1] The prescription of punishments actually tells us more about the severity of the wrongdoing than it serves as a guideline to punishment. It was rare indeed that these punishments were actually carried out. And if a need arose to punish a sinner, the court had the right and obligation to give punishment beyond what the Torah "allows" (Sanhedrin 46b). However, see Maharsha Sanhedrin 64b, who explains that at times, there is no punishment given because the sin is so great, punishment cannot atone.
[2] Whereas Western justice systems often focus on the perpetrator of crime, Jewish jurisprudence insists that any loss be restored to the victim.