As other posters pointed out, the notion that space is "empty" is problematic for other reasons, but you don't have to go into that detail to understand the answer to your question. It's much simpler:
The reason is the same why you can sit on your chair instead of dropping through the "99% empty" chair to the floor.
The particles that make up the chair, and your body (and the floor, and the bedrock your house is built on, etc.) all exert forces that work at quite a distance from the particles themselves. According to the standard theory, there are four such forces, known as gravity, electromagnetic, strong force and weak force (you don't have to worry about those details to get your question answered. Just know that all of them work a certain, small or large, distance away from the particles themselves).
Basically, the "empty" space is actually full of those forces. Those same forces also act on the photons that make up light. The photons thus bounce around not off particles themselves, but essentially off the forces. As an aside, the assumption that light travels in straight lines through space is also false, because light can, and does, get deflected by gravity.
Your question is actually much more insightful than it seems at first glance. There really is (probably) a kind of matter that acts the way you thought: dark matter. This is because, according to the most prevalent theories, dark matter particles do not exert most of the forces (only gravity). Light simply passes through clouds of dark matter. Caveat: this is currently subject of intense research, not yet firmly established as certain fact.