I think another factor that lends itself to our propensity for magical thinking is an inadvertent consequence of our abilities of pattern recognition.
We take it for granted and it is so ingrained in us and so intuitive that we don't even give it a second thought... but our brains are the most powerful pattern recognition tools on the planet. We can see a face in clouds, a bear or tiger in a few stars, etc. Our brains are constantly scanning for patterns and associations, so much so that we will see patterns when they aren't even there.
There is a famous study done on association, pigeons and mice were given food pellets at random time intervals. Whatever the subject was doing at the time of its food pellet became an act the subject would do whenever it was hungry. It only took a few coincidences of getting the food pellet while it was doing whatever act for the association to form. So, a pigeon was bobbing its head when the first food pellet arrived. Then later, the scientist waited until the pigeon bobbed it's head and then he administered the next food pellet. Often that is all it took. From that moment on, whenever the pigeon was hungry it would bob its head like crazy (sometimes for hours) thinking that its action were summoning the food pellet.
I submit that magical thinking with people is a similar byproduct of association. Somewhere in our development, we associate our wanting something with us obtaining it. We come to believe we can impose our will on the physical world by hoping or wishing for something. We can hope or wish for hours, days, weeks, and months and then when that something occurs we can claim victory and proof that it was our magical thinking that resulted in the action taking place. Whether that action was something within our control or not almost doesn't matter.
I want it to rain, I imagine rain clouds forming, I do a rain dance, and a few days later it rains. Obviously, it was my doing.