|MadSci Network: Astronomy|
Space is, on average, a vacuum because there is so much space between galaxies, stars, and planets. All of the mass of the universe is caught up in stars (which make up galaxies) and planets. In between are vast, almost unimaginable distances, where there is nothing but a few hydrogen atoms (thus virtually a vacuum) every cubic meter.
Whatever matter was between stars was, over the course of billions of years of cosmic evolution, attracted by gravity to become part of galaxies and stars. So the answer to your question is really two fold:
1) Space is very large and does not contain that much matter so that even if the matter were evenly distributed, the density would be extremely low, close to a vacuum.
2) The attractive pull of gravity makes the matter clump so that there is little matter left between the clumps (for instance between stars). That interclump (interstellar) space therefore is pretty much a vacuum.
Try the links in the MadSci Library for more information on Astronomy.