Is there a Kabbalistic or Hasidic meaning on the wearing of a Kippah/yarmulke? I understand it’s more a Minhag than a technical Halacha but I wanted to know if there is a mystical perspective on this. Preferably both a Kabbalah and Chasiduss reference.
Men wearing a head covering (though not necessarily a kippa) is mentioned a few times in the gemara: Kiddushin 31b:
רב הונא בריה דרב יהושע לא מסגי ארבע אמות בגילוי הראש, אמר: שכינה למעלה מראשי
Rav Huna son of Rav Yehoshua would not walk four cubits bareheaded, saying "the Divine Presence is above my head"
Again seen in Shabbos 118b:
אמר רב הונא בריה דרב יהושע: תיתי לי דלא סגינא ארבע אמות בגילוי הראש
Rav Huna son of Rav Yehoshua said "good should come to me, for I do not go four cubits bareheaded."
Also mentioned in Shabbos 156b:
אימיה דר"נ בר יצחק, אמרי לה כלדאי: בריך גנבא הוה. לא שבקתיה גלויי רישיה, אמרה ליה: בכסי רישיך, כי היכי דתיהוו עלך אימתא דשמיא, ובעי רחמי. לא הוה ידע אמאי קאמרה ליה. יומא חד יתיב קא גריס תותי דיקלא, נפל גלימא מעילויה רישיה. דלי עיניה, חזא לדיקלא, אלמיה יצריה. סליק, פסקיה לקיבורא בשיניה
Rav Nachman's mother was told by astrologers that her son (Rav Nachman) would be a thief. (Because of this prediction,) she did not let him wander bareheaded, saying "cover your head, so the fear of heaven will be upon you, and ask for mercy (that you will not fall to the evil inclination). Rav Nachman didn't understand why his mother told him this. One day, Rav Nachman was learning under a palm tree, and his head covering fell off his head. He looked up and saw the tree, and his evil inclination attacked him (making him want to steal dates). He got up and (because of the strength of his desire) cut the dates with his teeth.
From these Gemaras, we can see that a head covering is supposed to be a reminder of God's presence, as well as of his greatness (presumably because it being on one's head symbolises God's dominion over and control of us, showing that 'God is above our heads' in the hierarchy of power, or something along those lines). It is interesting to note that this is the same reason given by Rashi for the obligation of judges and people visiting the sick to wear a head covering (source needed).
We can also see that a head covering is a sign of respect for God (in the first gemara mentioned) and a head covering is needed to separate between God's presence and our own. (Not to say that we are separate from God and not under his control, of course. Rather that we are not holy enough to interact with Shechina (divine Presence) at all times.)
There seems to be some discussion in the rishonim about whether this is a halachic obligation or a good mincha, but the shulchan aruch (Orach Chayim 2:6) says it's an obligation.