The final launch of the Nasa space shuttle takes place next week. Dreamed up more than 50 years ago, the shuttle was seen as a first step for the new high frontier: as a nimble all-purpose vehicle to carry people, hardware, groceries, air and water into high orbit and then come back for more. It followed on from the Apollo moon programme – billion-dollar throwaway technology where everything was used only once.

The shuttle programme was initially authorised in 1969 – the year in which visionaries, and politicians too, dreamed of human colonies on Mars and the moon, and slowly-wheeling satellite cities of 10,000 people or more, exploiting the riches of captive asteroids, all by 2001.

By the time it was launched 30 years ago, the Star Trek dream had faded, and the cold war had cruelly intensified. The shuttle was by then a military tool, and an awkward compromise: a plane-shaped rocket that had to be flown from California landing strip to Florida launch pad on the back of a jumbo jet; a rocket-powered plane that must glide home from near-Earth orbit with the help of computers and a crazy flight path. Today, at the end of three decades in service, the shuttle looks increasingly like an idea that took Nasa for an expensive ride.

The first shuttle, Columbia, took off with a two-man crew on 12 April 1981, exactly 20 years after Yuri Gagarin's historic first orbit of the planet. The 135th and final mission goes up on 8 July with a crew of four aboard Atlantis for 12 days, and that will be the end of manned flight for Nasa for an indeterminate period. The agency will still maintain an astronaut corps, but the space pilots will have nothing to fly.

During its three decades, the shuttle – known in Nasa-speak as STS, the space transportation system – lifted untold amounts of secret military hardware into orbit, nursed the Hubble space telescope and delivered the tools, manpower and prefabricated structures for the International Space Station. It stimulated remarkable advances in engineering, robotics and communications, and facilitated a wealth of scientific research.

But there was a cost. Seven astronauts perished when Challenger exploded during take-off on a frosty Florida morning in January 1986. Another seven died when Columbia broke up as it hit the upper atmosphere on the way home from the space station in February 2003.

Space is an unforgiving environment: dangerous to get to, equally dangerous on the way back. So every successful mission was a triumph of engineering complexity. At each launch, around 2 million kilograms of intricately connected hardware – each shuttle has 2.5 million parts – had to be accelerated from a standing start to nine times the speed of a rifle bullet just to reach the safety of freefall. The investment in each launch was colossal. The solid rocket boosters alone burn fuel at the rate of 5,000kg a second at each launch and the temperatures inside the shuttle's main engine get high enough to make iron boil. And the vessel had to take with it everything humans might need to survive in space, every time.

But reusable did not mean cheap. Every flight into space involved stress and abrasion as the machine tore through the air on the way up, and then went from sub-zero temperatures in orbit to more than 1,500C as it hit the atmosphere on the way down. As the fleet aged, the pit stops became longer and launches less frequent.

Two scientists at the University of Colorado calculated an average cost for each launch of $1.2bn. Nasa – begetter and guardian of the International Space Station, the Hubble space telescope and the yet to be launched James Webb space telescope – already has more financial demands than it can meet. President Obama cancelled plans for a new manned mission to the moon; the long-promised manned mission to Mars now looks very distant.

Once Atlantis returns, it will join its fellow survivors Discovery and Endeavour as US museum exhibits. And when the crew aboard the ISS need any more tea and sugar, or fuel and fresh air, these will be delivered by a Russian robot Progress cargo vehicle, or a European Space Agency automated transfer vehicle, neither of which is reusable. For years to come, the only carrier available to get people to and from the space station will be the Russian Soyuz, descendant of a line launched in 1966.

The space shuttle broke all records; but in the end it all but broke Nasa.