Jewish law and Jewish ethics are intertwined, with one defining how the other is implemented. An ethical mandate must still be fulfilled only within the letter of the law; a law must be followed with ethical behavior.
Here is an example, from a book I’ve been reviewing recently, the Chazon Ish’s Emunah uBitachon (Perek 3 – translation and any errors are my own):
At times, ethical obligations and halachic rulings are a single unit, with the law determining what the ethical system will prohibit or permit.
For example: Bava Batra 21b says regarding competition between schools that there is no legal standing for an argument [against a new competitor] of, ‘You are interrupting my livelihood.’
Therefore, we have the following situation: A city has schoolteachers who are supported by their work, and then new teachers suddenly arrive from elsewhere. Naturally, people are not satisfied with the old teachers and jump to the newcomers, harming the established teachers of that city. The injured parties develop hatred in their own hearts against their new assailants, and out of this heartfelt hatred they seek complaints, blemishes and claims against them. They teach their tongues to speak evil about them, and they go from evil to evil to produce empty charges and awaken the community’s mercy against the cruelty of the newcomers. They increase quarrels and fights, and sometimes even take revenge, as they are capable.
All of these deeds would be innocent of sin if the law agreed that they could block the newcomers. Then the newcomers would be the ones sinning with their lives, rebelling against the law which was stated to Moshe Rabbeinu at Sinai. There would be no prohibition against strife, harmful speech or baseless hatred. Indeed, there would be a mitzvah of battling in order to establish proper religious conduct.
But the law has determined that jealousy between scribes increases knowledge, and that this basic principle is of greater importance than the life of individuals. Therefore, the newcomers are acting within the law and those who stand against them are spilling innocent blood. When they hate the newcomers they are transgressing, ‘You shall not hate your brother.’ When they speak evil against them they violate the prohibition against harmful speech. When they gather groups to quarrel they violate, ‘There shall not be one like Korach.’ When they take revenge by preventing the newcomers from succeeding, they violate, ‘Do not take revenge.’
So when Bava Batra 21b says, “Rav Huna agrees regarding schoolteachers, that they cannot prevent [competition],” that law includes many resulting ethical obligations….
When the city’s established schoolteacher cries out before Gd, ‘Save me from my pursuers, for they are stronger,’ a voice replies from the heavens, ‘Woe to those who act like Zimri and ask for reward like Pinchas! You are the pursuer! You are the one who does not honor the Torah! I wrote in My Torah that a schoolteacher cannot block [competition].’
The upshot: Ethical obligations and expectations are about more than my own moral compass. Within Judaism, my moral compass must be linked with and informed by, my awareness of the law, and must function within that law.
And then, of course, we must add the flipside: Ethics provide boundaries for our actions just as the law does. The fact that one is legally justified in an action does not mean that he must take it; there is a concept of לפנים משורת הדין lifnim mishurat hadin, transcending the law, such that we consider a person praiseworthy if he forgives his rights.
Therefore: The new teachers are praiseworthy if they avoid competing. And those who live in the town are praiseworthy if they do not block the newcomers, even where they have the right to do so.