The easy response would be that the earth looks blue from space because it is more than two-thirds water. By this reasoning, because water is blue, the earth looks blue. This would be an over-simplification of a complex question that isn't exactly true. Have you ever dipped a clear cup in the ocean and looked at the water? It's not blue.
Because the ocean is made up of water molecules, these molecules absorb wavelengths of light from the sky. The wavelengths that are most easily absorbed are those that are ultraviolet and infrared. This means the deeper you go in the ocean, the less warming from the sun there will be and the more bluish hue you will see as the red light wavelength is absorbed elsewhere.
In addition to the appearance of blue water on earth, the sky also is blue. The reason why the sky appears blue is because the earth's atmosphere is able to more efficiently spread blue light rather than red, thanks to the fact that blue light boasts a shorter wavelength.