Tonight, millions of people will tune in to watch the final episode of the BBC's Wonders of the Solar System. The programme has achieved unprecedented ratings for a science documentary series, ratings that have BBC executives sighing with relief. The tarnished image of public service broadcasting has received a little polish thanks to the programme's success. Filming for the follow-up series, Universal, begins next month.

It's tempting to put the series' success down to the presenter, "rock-star physicist" Brian Cox. A professor at the University of Manchester, Cox certainly is charismatic, knowledgeable and enthusiastic, and he has an engaging, no-frills approach to his delivery. (The good teeth and hair don't hurt, either.)

The real star, though – without wanting to take anything away from Cox – is the solar system. It genuinely is stuffed with wonders. I challenge you to watch footage of Jupiter's Great Red Spot, a whirling tempest large enough to swallow the Earth three times over, without feeling awed. Let's be clear: it's just a big storm, the movement of molecules of atmospheric gas. We live in a scientific age when we can explain this with cool, clear logic. And yet we can't help but respond emotionally.

If you pass the Spot test, try looking dispassionately at the image of Earth beamed back by Nasa's Cassini-Huygens spacecraft. The picture is taken from beyond Saturn, and our planet is a pale blue dot in the background. Home is a lonely few pixels in this jaw-dropping image, millions of miles distant. As Carl Sagan said of a similar picture taken by the Voyager spacecraft, "Our planet is a lonely speck in the great enveloping cosmic dark." If ever you wanted perspective on your place in the universe, that should be enough to last a lifetime.

And herein lies the power of astronomy. It taps into our very human desire to know who we are, where we came from, and how we fit into the bigger picture. Looking at the seething, roiling surface of the Sun, where a flare a million miles high can leap out into the vastness of space, we get a sense of our insignificance. But – and here's one of the keys to the success of Wonders – we can extract whatever we like from the experience. There are no right or wrong answers. Whether you are religious, an atheist or agnostic, you can look into the heavens and gather material that confirms your world view. The sky is a blank page on to which we write our hopes and fears.

It started with astrology, of course, the idea that the movement of the stars and planets determines the fates of the poor, humble souls who walk the Earth. This primal notion is still with us, judging by the astronomical salaries paid to the tabloid astrologers. It's easyto scoff at the fact that people living in a modern, scientific age are still willing to believe stars and planets can direct their fate. But don't laugh: it is our default position.

Modern neuroscience, combined with sophisticated psychological experiments, has made it clear that humans read significance into almost anything. We have evolution to thank for that. Our ancestors were the survivors of a dangerous landscape, who instinctively ran when they heard a strange noise. We didn't get where we are today without reading too much into every natural phenomenon, so we were never going to be able to resist interpreting lights in the sky.

This is why the power to predict the motions of the heavenly bodies became such a precious commodity. If you know how the heavens work you can impress and exercise control over those around you. And so, extremely early in human history, began the uneasy relationship between astronomy and religion. The link continues even into this scientific age. Today, for example, Easter Day, is a date that is determined by consideration of the phases of the Moon and the position of the Earth relative to the Sun.

Every major religion draws on the heavens for metaphors of infinity, helplessness and mystery. The myriad stars are an indication of a deity's power. The vastness of space gives a useful sense of insignificance. The unknowability of what's out there mirrors the ineffable. Add it all together, and it plays beautifully into the hands of priests and shamans.

It's no surprise, then, that organised religion has always struggled against science's growing grip on the heavens. The way things stood in the 15th century was just fine for the Catholic church: God controlled the motion of the planets and stars; humans were at the centre of His creation, and priests provided the necessary mediation between the terrestrial and celestial spheres.

Then along came Bruno, Copernicus, Galileo and Newton. Slowly, the church's sphere of influence waned. By the end of the 18th century, scientists were writing God out of the picture. In 1796, the French aristocrat Pierre Simon, Marquis de Laplace, published a book on the mechanisms of the universe. It mapped out all the movements of the planets using Newton's gravitational theory, and did not mention God once. This amused Napoleon, who asked Laplace how he could write a book about the universe without mentioning its creator. "Sir," Laplace replied, "I had no need of that hypothesis."

So all we have left now, really, is wonder. But the interesting thing about this irrational awe is that the scientists feel it, too. Carolyn Porco, head of the Nasa Cassini-Huygens mission that is exploring Saturn, waxes evangelical about her role. "Being a scientist means staring immensity and eternity in the face every day," she says. "It's about as meaningful and awe-inspiring as it gets."

Porco says looking at her spacecraft's picture of Earth as seen from beyond Saturn provides a near religious experience: such images are the iconography of science. The Cassini-Huygens mission provides a metaphor, she says, for "a much larger human voyage to understand the interconnectedness of everything around us and also how humans fit into that picture".

This idea of the "interconnectedness of everything" is similar to the theme expounded by the Harvard University biologist E O Wilson. Wilson talks about our "biophilia", an innate connection we feel with the living world. But biophilia seems to be part of something much bigger, a connection to the physical landscape we inhabit. It is almost as if we enjoy feeling small. And there is no bigger vista for human beings to consider than space.

It's no wonder that the Earth is littered with astronomical artefacts. There's neolithic Stonehenge, with its alignment to the rising midsummer and midwinter sunset. Chaco Canyon in New Mexico contains the Fajada Butte sculpture, where a spiral carving is split in two by the Sun's rays at noon on the summer solstice. Mexico has plenty of ancient astronomical features. Some are extraordinary feats of engineering, such as the "zenith tubes", where the Sun's light enters only at specific moments of the year.

Then there are ancient scientific instruments such as the "Antikythera mechanism" salvaged from an ancient Greek shipwreck. It appears to be an astronomical computer that can calculate the motions of the planets and stars, the timings of eclipses and the phases of the Moon.

It seems we have always had a need to grasp the heavens. The physicist Steven Weinberg summed it up with typical flair. "The effort to understand the universe," he said, "is one of the very few things that lifts human life a little above the level of farce, and gives it some of the grace of tragedy."

In an age when science struggles for funding, there is an important lesson to be learned from the success of Wonders of the Solar System. Because we live under skies occluded by smog or streetlights, it appears that people need astronomy more than ever. The stars provide our connection with all of humanity, past and present. Everyone who has ever walked Earth's surface will have looked up at the sky and asked the same questions that come while listening to Cox's rapt, lyrical commentary. We might live in the age of rational enlightenment, but we are no less awed for that. In the universal, persistent fascination with astronomy, we may have found the ultimate measure of what it means to be human.