We have plenty of water, just not clean water. Besides, it is too expensive.
The real problem isn't a shortage of water but a shortage of clean water. Earth's surface is about 71% water-covered but around 97% is salty and not suitable for drinking. That leaves a small portion as fresh water. About 70% of that fresh water is in the form of ice and less than 1% of the world's fresh water is readily accessible so much of Earth's population has some sort of water shortage.
So why not just join hydrogen and oxygen to make water? It could work and it would be beneficial in producing usable energy at the same time. Hydrogen and oxygen burn very well together and were used in the main engines of the space shuttle. Hydrogen and oxygen react in a more mild manner in fuel cells which make electricity.
There are a couple problems though.
1. Hydrogen and oxygen are expensive to make as pure gasses. That alone makes it an impractical source of water, especially in areas of the world where there is a shortage of fresh water.
- When hydrogen burns with oxygen, we get water vapor because the reaction is so hot. Water vapor tends to escape easily. A fuel cell produces less heat so it would be easier to keep the water from getting away.