That's because the blue light waves are shorter than the other colors, so they bump into the molecules more often and scatter more easily. As a result, when we look up at the sky, we see all this ...
If Earth had no atmosphere like the Moon there would be no scattering, and the sky would remain black, even in daylight ...