I have a theory about this - it happens because we haven't found a way to teach kids about the connection between human effort and software created as a result of work. A huge amount of a child's education at all ages is learning how things are made. As they grow up, kids are naturally exposed to information about how the interesting things that surround them in the physical world are manifested. Buildings are erected with construction equipment, which are made in factories by machines and workers with tools. Food is made by growing and processing ingredients, which come from farms. Roads are created by construction workers with plans and maps and big machines. Society works because people do things and make things and organize things. Look in any kids book with lots of pictures and you'll see what I mean.
But software is different. Construction of software is not physical or visceral and so we can't really show kids how it's made, and most software that people actually use is so vastly complicated and visually oriented that we can't make a connection between it and simple logical concepts that kids can understand (following directions, "if" statements, "while" loops, etc.) The result is not only magical thinking, but a belief that most/all software just magically springs from the void. I've had many conversations with people who never stopped to consider that all the stuff they use on their computer was actually created by people who thought it up and then made it happen - that it's a result of human effort.
By the time people reach the age where they can learn this stuff, the empty area between "effort" and "working software" is so baked-in that they can't even comprehend that they can make computers do new things by thinking and working.