As clean freshwater has become scarcer around the world—especially in arid regions such as the Middle East and North Africa—those countries that can afford it have increasingly turned to desalination.