The light from the Sun scatters based on what's in the atmosphere. Sunlight comprises light of many different wavelengths, and molecules and dust particles only interact with specific waves. The scattering of light by these particles is key to the color that we see.
The atmosphere on Mars is very tenuous, its pressure is equivalent to about 1 percent of Earth's. It is made of carbon dioxide and has a lot of dust. This fine dust tends to scatter red light so that the sky appears reddish, which lets the blue light through.