Building Religions 1: Max Weber
I've been thinking lately about religion in the Ingressa, which is leading me to muse about applying a few academic theories to the process of creating religions for fictional settings in general. If this is the sort of thing that interests you, read on and feel free to share this.
Let's start with Max Weber's Sociology of Religion, in which (as you might guess) he ties the development of religious ideas with socio-economic ones. Cultures develop cults around the needs of their environment, and as those cults become professionalized (i.e., their practices are passed along among a specific group of people), the object of their practice solidifies into the idea of a god or goddess. Pantheons come later, and tend to be organized parallel to the structure of the society itself: deities might be seen as individual families, a tribes, a monarchy, and so on, depending on how the society sees itself as a whole.
As society grows more complex, deities connected to social relationships start to become more prominent. Gods of law, contracts, rulership, and justice begin to appear, reflecting the importance that society places on these ideas. (He detours into the argument that these gods have often been associated with the heavens because they're meant to represent fixed or enduring concepts, and the stars are the most fixed symbols that we have.) If a society expands to incorporate others, then it has two choices in terms of what to do with new deities. It can either draw them into the existing pantheon by identifying a new god as an aspect of a familiar one, by marrying one god to another, or by claiming some similar social relationship; or it can cast the new deity as a demon or a conquered adversary.
As societies expand into empires, a few things happen. First, the gods of social relationships become even more important, since they're the ones holding the entire system together. Second, the personalities of those gods become more abstract so as to allow an increasingly diverse range of people to acknowledge them. (In the Ingressaverse, the All-in-One to which the interstellar Order of the Red Clover is devoted is an excellent example of this.)
So what does this mean for worldbuilders creating religions? It means that, if you want to use Weber as a model, you should begin by thinking about a society's needs before putting together a pantheon of gods. You're not going to get a god of thieves unless theft is a sufficiently important social concern for some sort of cult to form around the concept, or being a thief becomes a recognized profession. You're probably not going to get gods who are specifically imagined as the four elements unless people have already made a philosophical leap to organizing the world along those lines. If you're creating an empire, then the idea of empire is likely going to be translated into the ruling deity.
And so on.