Qatar has no surface freshwater or groundwater. So all of their water is desalinated. It’s often still quite salty to the taste though - the last few ppms would be an exorbitant cost to remove.
However, Qatar has 3 million people. Iran has 92 million people - 9 million in Tehran alone. So their half of that gas field in the Gulf contributes far less energy per capita.
And even if the energy is free (unlimited natural gas, fusion, magic, whatever) desalination is still fairly expensive. I think only about 50% of the cost is energy, the other half is CapEx, operations, and replacing the membranes as they get used up.