It isn't actually blue in some ways. Some says it is violet, however the sky being violet is only halfway of the truth. It actually is a spectrum of colors, but because of some factors caused by nature, we can only see it as blue or violet. It's our eyes that percieve it as blue or violet. We see the sky as mostly blue. This is because the light transmitted composed of spectrum of colors. Actually, the longest wavelengths of light are on the red end and the shortest wavelengths are on the blue and violet end of the spectrum.
When transmitted light such as the sunligh enters in the atmosphere it then collides with the oxygen and nitrogen molecules. So the color with the shorter wavelength which is blue and violet is scattered more by this collision. And because violet and blue are the shortest wavelengths as I have stated above the sky likely appears to be violet or blue. But because our eyes are more sensitive to blue light than they are violet light, we perceive the sky as blue.