Yeshiva University is unique in that, compared to any other Yeshivah in the world, they let their students get away with a ton. YU does not force anyone to be religious. They don’t kick people out for not keeping Shabbos or touching girls. The basic assumption is that they want these people in a Torah environment and hopefully they will learn something from being around Rebbeim and other Halacha-obserant Jews.
Because of this, most students have respect for the environment that they are in. A YU student who does not wear a Kippah is not an unheard of phenomenon. But all of them will at least try to put one on during the morning classes—and at the very least won’t flaunt that they won’t wear them. Someone who proudly displays his lack of a Kippah shows that not only does he have no real interest in what the morning classes have to offer, but that he wants to show open disregard for it, even in those very same classes. Is it any wonder that a teacher in those classes would refuse to teach him?
The Gemara in Horiyos 11a discusses whether certain things make someone a Mumar. There are many different types of Mumar, all of them having to do with a certain level of nonobservance. There are a lot of technical details as to what difference it makes whether someone is a Mumar. In that Gemara, the Gemara mentions that someone who violates laws Lehachis—“in order to anger (G-d)” is a Min. A Min is a heretic that has the strictest of prohibitions placed on him because of it. One opinion in the Gemara is that even one who wears Shatnez D’Rabannan falls under this category. Two reasons are given for this in the Rishonim. One is that someone does not incur any tangible loss by wearing Shatnez over normal clothes; the other is that it is readily noticeable by everyone. In either case, refusing to wear a Kippah should fall under this category. Once again, is it any wonder that a Rabbi would refuse to teach such a person?
(Note: In our editions of the Gemara, the text refers to someone who does something prohibited Lehachis as a Sadducee. This is very clearly a censored text. The word “Min” in the Gemara often refers to the early Christians and thus that word was often censored out, even when it is not referring to Christians. Many manuscripts had the word Min instead of Sadducee.)
The custom for everyone to always cover their head only became prevalent at some point within the past 400 years. I once saw a statement attributed to the Or Zarua (13th century; I searched for the precise location while writing this piece but couldn’t find it) bemoaning the fact that almost no one wears a Kippah even while praying or studying Torah. Rabbi Shlomo Luria (16th century; Maharshal Responsa 72), on the other hand, complains that the people are stringent to wear a Kippah while praying and learning and that it’s not necessary.
The Shulchan Aruch mentions in Orach Chayim 2:6 that one should not walk 4 steps with his head uncovered. The commentaries there all point out that this is only a Middas Chassidus and not an actual Halachic requirement. In O.C. 91:3 he mentions that one should always wear a Kippah while praying and that one cannot enter a Beis Medrash with their head uncovered. These Halachos in 91:3 are sourced in the Gemara, though for some reason many Rishonim did not feel to mention them. But if one assumes that 91:3 includes learning Torah even though only prayer is mentioned explicitly, then a Rabbi could very easily hold that he is forbidden to teach Torah to someone with an uncovered head because of Lifnei Iver. The Taz (17th century), in O.C. 8:2, wonders why seemingly everyone in his time was very observant of the Middas Chassidus to always cover one’s head. He thinks that the people accepted it as an Issur of Chukas Hagoyim (though his wording is a bit strange, so he likely did not really view this as a pure Issur D’Oraisa) and the later Poskim have mostly accepted the Taz’s reason.
The fact that there is no pure Torah or Rabbinnic source for obligating someone to wear a Kippah might make the obligation to wear a kippah stronger than just any Issur D’Rabbannan would have. There is a concept that a publicly accepted Minhag has the status of a Neder (vow) D’Oraisa. It could very well be that nowadays wearing a Kippah is a D’Oraisa obligation because it’s a Neder. Still, everything within Judaism is bound by a Halachic framework. Even within social and communal expectations, everything is based in Halachah. Thus, someone who refuses to wear a Kippah may very well have the status of a Min mentioned above.
This is not an issue of communal comfort or fitting in. These are applications of Halachic concepts that we have in the Gemara and Poskim.