This has been the western world's most popular explanation for magic for centuries; a driving force behind 19th century colonial characterizations of indigenous people as "primitive" and "ignorant". One of the first official tasks of the young discipline of Anthropology was to dispel this myth.
Consider the famous opening lines of the 1925 essay Primitive Man and His Religion:
"There are no peoples however primitive without religion and magic. Nor are there, it must be added at once, any savage races lacking either in the scientific attitude or in science, though this lack has been frequently attributed to them. In every primitive community, studied by trustworthy and competent observers, there have been found two clearly distinguishable domains, the Sacred and the Profane; in other words, the domain of Magic and Religion and that of Science."
Malinowski's choice of words like "primitive" and "savage" reveal his 19th century roots (he was born in 1884), but he was destined to help turn Anthropology away from from colonial heritage and bring it squarely into the middle of academia. So don't get distracted by the terms.
Malinowski wanted to test the prevailing idea that magical thinking resulted from incomplete understanding of real causes -- that it resulted from ignorance. He developed a simple hypothesis to test the theory: If profane knowledge trumps sacred knowledge, then the more someone understood about the "real" causes of something, the less likely they would be to have magical beliefs about it.
In 1914 he went into the southwestern Pacific to collect ethnographic data on this and many other subjects. His research there, published in a number of articles and also in the seminal volume, Argonauts of the Western Pacific (1925), set the standard for Anthropological fieldwork expectations that exist to this day.
In the village of Kiriwina in the Trobriand Islands (near Papua New Guinea), he found a society where magic, magical knowledge, and magical thinking permeated all aspects of life. This was a perfect place to test the old hypothesis. He began documenting the areas in which the Trobrianders had the most advanced technical skills and profane understanding of the natural environment.
The areas where they were undeniably most expert were in fishing, farming, boat-building, and navigation. By anyone's standards they had a highly sophisticated set of secular knowledge of how to do these things, and do them well. They were accomplished open-water navigators, with excellent seamanship skills, understanding of weather patterns and currents, seasons, astronomy, and knowledge of the stresses and limits their watercraft could withstand to make a voyage.
Simultaneously, he collected data on the areas of daily life where people used magic, or depended on magical knowledge the most. He found high incidences of magical knowledge and ritual associated with.... did you guess? Fishing, farming, boat-building, and navigation. This is precisely the opposite of what you would expect if profane knowledge was expected to eliminate or minimize dependence on magical knowledge.
Rather than being associated with ignorance of "real" causes, magical knowledge and magical ideologies were related to uncertainty and danger. Open water navigation was one of the most dangerous aspects of a male adult's life. One mistake at sea when out of sight of land could have deadly consequences. Furthermore, mistakes in reading weather or land signs would be magnified, not only risking your own life but the lives of others. Fishing is an activity with widely unpredictable results. Even the best fishermen can not guarantee results on any given day. Both fishing and farming are critical to survival, so failing at one of these should be considered dangerous.
So how does magic, religion, or an ideology of the supernatural help minimize danger or improve the odds of success? Malinowski couldn't say, but suggested the psychological benefits of these could be immense. Furthermore, ritual can often help people to help transmit knowledge from one generation to the next, and serve as mnemonic devices to remember the multitude of successful actions that may need to be taken to be successful in these areas. The co-occurence of magic and technical knowledge in these areas is undoubtedly because both are needed to deal with these dangerous uncertain activities.
Regardless of the reason, Malinowski showed, rather finally, that belief in magic, or religion, is not founded on ignorance. There is literally no chance of a society dispensing with its supernatural beliefs because of science. Perhaps now is not the time to get into it, but religion does too many things for people that science doesn't do, such as provide social support, a local sociopolitical framework, a local educational network, and a fraternity of allies in times of crisis.
At best, science can provide ways of minimizing danger and improving the odds. In this sense, as technology becomes more advanced you might hypothesize that magical ways would become less prevalent. Consider the psychological benefits of Wellbutrin or Effexor? Perhaps with a combination of antidepressants, mood stabilizers, high tech boats with fish-finders, and refrigeration systems the Trobrianders won't need magic anymore.
No, people do not believe in magic because they are ignorant. They believe in magic because it works.
Malinowski, B. (1922) Argonauts of the Western Pacific: an account of native enterprise and adventure in the archipelagoes of Melanesian New Guinea. London [England] : Routledge & Kegan Paul.
van der Elst, D. (2003) Culture as Given, Culture as Choice. Prospect Heights [Illinois]: Waveland Press.