We see the sky as colored because our atmosphere interacts with the sunlight passing through it. This phenomenon is called "scattering." The type of scattering responsible for blue sky is known as Rayleigh scattering. Because this effect becomes sharply more pronounced as the energy of light increases, wavelengths at the blue end of the spectrum, where energy is the highest, are scattered preferentially. The sunlight reaching our eyes has a high ratio of short, bluish wavelengths compared to medium and long wavelengths, so we perceive the sky as being blue.
Without an atmosphere the sky appears black, as evidenced by the lunar sky.