Each week, twelve loaves of bread were baked and placed on theshulchan, the table, situated just outside the Holy of Holies. It was divided up a week later between the members of the mishmar, the group, of kohanim who were starting and finishing their weekly work cycle. Apparently, the baking of such required special workmanship. Beit Garmu refused to share their know-how with others and the rabbis fired them, bringing expert bakers from Alexandria, Egypt, to replace them. Unfortunately, "they knew how to bake like them, but they did not know how to remove it from the oven like them". Hearing about the poorer quality of the replacement workers, the Sages--invoking the verse, "all that is created is for My name and glory"--sent for Beit Garmu to return to their post. Realizing their bargaining power had greatly increased, they refused to do so unless their wages were doubled. In explaining why they refused to teach others, they responded that they had a family tradition that "this house is destined to be destroyed; perhaps someone who is not worthy will learn and use the bread for idol worship". A nice argument but not necessarily persuasive.
When Hizkiyahu told Isaiah that he did not have children as he foresaw that he would have wicked descendants, Isaiah rebuked him: "In these hidden Divine matters, why do you involve yourself?" (Brachot 10a). Our task is to do what we must do and not worry what may happen long after we are gone. There are so many factors that can change the course of history, including our own righteousness. And even if history is not changed--and Hizkiyahu did beget Menashe, the most wicked of kings ever to rule (and he had lots of competition)--that is not our concern.
Interestingly, the rabbis' response was to find something positive to say about Beit Garmu, even if they were upset by their uncooperative behavior. "And for this thing they are to be praised; that clean bread was never found in the hands of their children, lest one say, from the lechem hapanim do they benefit, to fulfill what the verse says, 'and you shall be clean from G-d and Israel'" (Bamidbar 32:22). This verse is the source of ma'arit ayin, where we must worry not only that we do no wrong, but that we are not perceived to be doing wrong. And this fear is greatly compounded for those who work in the public service. Beit Garmu may have been wrong, but at least no one could accuse them of using their work to derive personal benefit.
The Gemara has an almost identical explanation regarding Beit Avtinus: they refused to teach the method for the ketoret, the eleven spices offered daily. Again, they were fired, their replacements from Alexandria were not up to the task, and Beit Avtinus demanded a doubling of their salary to return. They, too, explained that they were afraid that, after the destruction of the Temple, some would improperly continue to make the ketoret. In order to avert any question of personal benefit, Beit Avtinus ensured "that no bride ever left their house perfumed, and when they married a women from a different place, they would make a condition that she should not wear perfume".
Two more people came in for censure for their unwillingness to share their knowledge with others: Hugras ben Levi, who knew how to make beautiful sounds (likely some form of a cappella); and Ben Kamzar, who mastered the technique of writing with four quills simultaneously.
Some had better excuses than others, and the rabbis went so far as to apply the verse, "the name of wicked shall rot" to the family of ben Kamzar, "who had no answer for their actions". Interestingly, while Hugras ben Levi escaped such censure, as they had "an answer for their actions", the Gemara never says what it was. Presumably, it was less acceptable than those of Beit Garmu and Avtinas.
Whatever excuses one may have, our tradition demands that we share our knowledge--especially that of a religious nature--with others. Rav Soloveitchik would take great pride in being called amelamed, as such is the great manifestation of our Divine image: G-d is melamed Torah leamo Yisrael. Three times a day, we say, "You grace humanity with knowledge". When we grace humanity with the knowledge that we have acquired, we are following in the path of the Divine.