a) Theory of mind. We impute minds to others, including assuming they have beliefs, desires, goals, etc. This is a much more useful way to understand and predict the behavior of others than viewing them as complicated machines.
b) Essentialism. We tend to assume things have hidden essences that make them what they are, sort of like Plato's ideal forms. Probably useful for categorization of things.
c) Anthropomorphism. We are good at detecting patterns and are particularly attuned to detecting human (or otherwise agentic) features, but sometimes overdo it for a variety of reasons.
Cross these together, and you can get a disembodied agentic mind that constitutes an anthropomorphized essence of the universe (or something like that). But here's my question: why is God assumed to be good, and why is God looked at as a father figure? Why not a neutral essence? One important factor in exploring this is how universal the "goodness belief" is: if it's culture-specific, it may just be an add-on to the main religion package. That could change what level of explanation to look for--i.e. from evolutionary advantage or universal psychological phenomenon to a successful meme in particular cultures. (Admittedly, the gods did bad things in Greek myths, but as far as I know, they still expected piety from humans.) In any case, while I'm leaving the goodness issue open as an earnest question, I did think of two possible candidates, both of which I mentioned in that previous post without recognizing their significance.
1) One is the Just World Hypothesis: people are motivated to assume the world is a fair and just place, which seems to be comforting--if people get what they deserve, I can be good and therefore protected. And if the world is just, shouldn't we assume the agentic essence of the world is just and good? In this option, God's assumed goodness is a side effect of the Just World Hypothesis spilling over into the mix.
2) Another possibility is Illusions of External Agency. We all have "psychological defense mechanisms" that sometimes make us happier with what we have (for example, in post-decisional dissonance reduction). However, we usually aren't aware of the operation of those systems (would they work if we were?), and so people often assume that they got something objectively good, and go on to assume it must have been provided by a benevolent external agent. If religious belief arises in part from over-application of agency to the universe, this type of illusion could create the sense that it is a benevolent agent. In this option, God's assumed goodness is more intrinsically part of the anthropomorphic mix.
I'm not sure if these are the answer--or part of the answer--and again, I wonder how universal the goodness-belief is to begin with. I also still wonder where the parent part comes from. Why would a benevolent agentic essence be viewed as a father figure as well, or a creator? Perhaps this has roots in ancestor worship or crossovers from creation myths, but I don't know enough about those to say. Or is it connected to morality and parental relationships more directly somehow? Any ideas?