There are theories that the moon use to be part of the Earth, therefore, when the asteroid that hit Earth and sent a large chunk ( Theorized as our moon) in to space, that piece may have water on it from where it use to be part of the Earth.
When water evaporates, it forms clouds in the upper trophosphere, the part of the atmosphere we live in. Also, water vapor makes up a part of the atmosphere, which is why water condenses on your window.
It is part of the water cycle. Water evaporates due to heat from the sun. The water then condenses in the atmosphere to form clouds. Once enough water has condensed in the clouds, water droplets form and falls back to the earth in the form of precipitation.