I don't think you understand what comparative advantage actually means. Comparative advantage is why two places can produce the same good and have it be economically beneficial to both even though one has an absolute price advantage. It has little to do with why building large cities in the middle of the desert is bat-shit crazy.
From the article you linked to, comparative advantage is related to marginal cost, which is a comparison of two goods. The law of comparative advantage says if the costs of production for the two goods are different, it will be advantageous for the two parties to specialize and trade, even if one party produces both goods at a lower absolute cost (money, labor, time, natural resources, any way you want to measure it).
Suppose the north produces very cheap water and electricity. Further suppose the southwest produces slightly more costly, but still fairly cheap electricity, and very costly water. Even though the southwest is disadvantaged in both markets, it still benefits both parties if the southwest produces only electricity and the north produces only water.