According to Yogi Bhajan, one of the most adept yogis of our age, a head covering enables you to command your sixth energy center, the Ajna Chakra. This practice provides a sense of containment and focus while meditating or engaging in any work that requires mental clarity. In many cultures covering one's head is connected to their spiritual practice, with various ideologies as to why. Could it have originated as a pragmatic method to grounding mental energy and containing spiritual energy? You'll have to experiment yourself!