“Ve’lo techalelu et shem kodshi ve’nikdashti be’toch Bnei Yisrael”, “and you shall not desecrate my holy name and I will be sanctified amongst the children of Israel.”
This pasuk can be read as a cause and effect – do not desecrate my name and then I will sanctify myself amongst the children of Israel.However, in Rabbinic literature it is understood as teaching us two mitzvot; “Ve’lo techalelu”, the prohibition to desecrate the name of God and “ve’nikdashti” a positive commandment to sanctify the Name of God.
Rambam, in his Sefer Hamitzvot, distinguishes between the different circumstances where one would be faced with the prohibition of Chillul Hashem, the desecration of the name of God. The first of these circumstances is when a Jew is coerced to transgress a prohibition. If the prohibition is one of the three mitzvot categorized as yehareg ve’al yaavor, be killed and do not violate (the laws adultery, murder and idol worshiping) or if it is a time of persecution meant to wipe out the fulfillment of mitvot, one must choose death rather than violating the prohibition. Alternatively, even if it is not a time of persecution and not one of the mitzvot of yehareg ve’al yaavor but the sin must be done publicly, then one must refrain from transgressing the mitzvah even at the risk of death. Anyone who chooses to violate the mitzvah rather than die is viewed as desecrating the name of God.
It should be noted there is a dispute amongst the halachik authorities how to view a case where one is meant to violate the prohibition and not die, yaavor ve’al yehareg, but chooses not to violate the mitzvah, risking death. The Rambam (hilchot Yesodei Hatorah ch.5 halacha 4) is of the opinion that such a person has acted inappropriately and deserves a heavenly punishment of death. Rav Yosef Karo (in his commentary to the above mentioned Rambam – Kesef Mishne) states that other scholars disagree with the Rambam and rules in the Shulchan Aruch (Yoreh Deia 157/1) that this behavior is permissible.
The second circumstance where Chillul Hashem can occur is when a person violates any mitzvah with no benefit other than to rebel against God. When one eats non-kosher because he is hungry or even because he thinks it is tastier, there is no Chillul Hashem involved. However, if he eats a slice of ham after a hearty meal just for the sake of eating ham, he desecrates the name of God.
The last circumstance pertains to general behavior rather than formalistic halachik prohibitions. Whenever one behaves in a way that is not becoming of his religious stature, he desecrates the name of God. In this category, the greater and more recognized a person is the more exacting are the demands on him. The Gemarah Yumah (86a) offers examples for this type of situation quoting Rav as saying “If I acquire meat at the butcher and do not pay immediately, it is a Chillul Hashem”. Even though it may be accepted that people take the merchandise and pay only later, if the store owner follows up and makes demands for payment, it is inappropriate for Rav to delay the payment. Rashi explains that if Rav were to delay his payment it would appear as if he were showing contempt to other people’s property which constitutes a Chillul Hashem.
As the Rambam in the Mishne Torah (Hilchot Ysodei Hatorah ch. 5 halachot 4,10,11) notes the mitzvah ofve’nikdashti is the flip side of Chillul Hshem. Therefore, in all cases where one may desecrate the name of God by acting inappropriately, he sanctifies God’s name when choosing to act appropriately. Thus, when a person refuses to sin even at a risk to his life, if yehareg ve’al yaavor applies, he has sanctified the name of God. Similarly, when one is tempted to sin but chooses to distance himself from that sin, due to his commitment to the worship of God, he fulfills the commandment of “ve’nikdashti”. Likewise, when a person behaves in a manner that puts his religious stature to praise, he sanctifies the name of Hashem.