If you're inside a spacecraft, and you release water into outer space, what does the water do first?
And the answer: boil.
As air pressure decreases, the boiling point also decreases. So in a vacuum-like outer space, water boils. In fact, astronauts report that when they release liquids from their spacecraft, the liquids rapidly boil. Soon after, the vapor then freezes, producing very fine crystals.
Inside an oxygenated, zero-gravity environment, water becomes spherical. This makes sense, as without gravity to tug downward, the forces governing the objects are all the same. Consequently, the water droplet can only form the shape which has the least amount of surface area: a sphere.
However, outside of a pressurized environment, water changes form rapidly. Interstellar space actually has a pressure that’s millions (or even billions) of times smaller than Earth's, and the temperature is very, very cold. Thus, because water boils at a lower temperature at high altitudes, a low enough pressure will cause the water to immediately boil. When we talk about putting liquid water in the vacuum of space, we’re talking about doing both things simultaneously: taking water from a temperature/pressure combination where it’s stably a liquid and moving it to a lower pressure, something that makes it want to boil, and moving it to a lower temperature, something that makes it want to freeze.
Once the water has boiled, we then have isolated water molecules in a gaseous state, but a very, very cold environment. These tiny water vapor droplets now immediately freeze (or, technically, desublimate), to become ice crystals.
Learn more about the effects of space on water below.