How does the expansion of the universe make outer space a vacuum?
The vacuum of outer space is not caused by the expansion of the universe, but is caused by gravity. First of all, when we say outer space (the space outside the atmosphere of planets and stars) is a "vacuum" or is "empty", we really mean that outer space is nearly empty or almost a perfect vacuum. In reality, even the most remote spot of outer space has gas, dust, radiation, gravity, and a whole host of other things. There is no such thing as truly empty space. If we tried to suck all the particles out of a certain volume, we could still never get it empty. There would still be things like vacuum fluctuations, gravity, and dark matter, which can't be sucked out. With that said, outer space is very close to empty compared to earth's atmosphere. Why?
Every particle of matter, no matter how small, exerts a gravitational attraction on all other particles of matter. For small bits of matter like a hydrogen atom and for large distances like we see on the astronomical scale, the force of gravity is very weak. But it is not zero. Given enough time, gravity makes giant clouds of gas in space condense down despite the gravitational force being so weak. Soon after the Big Bang, the universe was filled with a nearly uniform soup of hydrogen and helium. Over billions of years, gravity pulled most of these gas atoms into stars. Inside the nuclear furnace of stars, hydrogen and helium were fused to form the heavier elements up to iron. Larger stars eventually died in an explosive supernova which created all the naturally occurring elements heavier than iron and spewed these heavier elements into space. Over time, these heavier elements condensed down under gravity to form small clouds and rocks. In turn, the clouds and rocks gravitationally attracted each other to form asteroids, moons, and planets. Outer space is nearly empty because most of matter that used to be out there has literally fallen into an asteroid, planet, moon, or star under the influence of gravity.
The expansion of the universe only affects the distance between galaxies, and does not increase the distances between objects inside a galaxy. Atoms in your body, creatures on earth, planets in a solar system, and solar systems in a galaxy are all far too strongly bound by gravity and electromagnetism to be affected by the expansion of the universe. As a result, the expansion of the universe cannot explain the relative emptiness of the space inside a galaxy.