Cardinals wear red ones. The Pope wears a white one. Rabbis often wear black ones. What's the difference?
Well, in this case, form does not follow function. Let's start with rabbis. Theirs are called kippot (pronounced keypoat), which is the Hebrew word for skullcap. The singular is kippah (keypah). You might have also heard them called yarmulkes (pronounced yamakas), which is a Yiddish word taken from the Polish word for skullcap. The reason why rabbis and many observant Jews wear them is because the religious book, the Talmud, orders them to: "Cover your head in order that the fear of heaven may be upon you."
So basically, it's a way of showing respect for God.
Combine this, with the fact that copes with hoods went out of fashion in the 13th century, and you begin to see where the tradition comes from. Yes, they were cold in the winter! (What with the lack of modern-day heating and such in our cathedrals.) Of course, today they don't need them to stay warm, but the tradition lives on.
And there are other religions and other similar traditions of covering the head. Zoroastrians wear topis; Druze men sometimes don a doppa and Buddhists often wear a bao-tzu.