Natural gas is reactive to the galvanized used in coating the pipe which therefore causing "flaking" inside the pipe. In my area you cannot use galvanized for this reason, even though the gas utility states that "their" gas doesn't do this. There are tons of gas lines and fittings that have galvanized mixed with black iron. Not too often have I heard of clogging directly to this stuation. Not a myth, just a code that covers the "what if".
IRCC, Black Iron Pipe typically isn't used for potable-water applications. Gas, Oil, Air--yes. Galvanized typically is for water, and a poor choice at that.
So, galvanized pipe is used only for water service, because if used with gas, there is a chemical reaction of flaking, which causes clogs and reduced strength of pipe. Is this correct???
It is my understanding, after talking to folks at PGW (Phila Gas Works), that the non use of galvanized pipe goes back to the early 20th centry and no longer applies to current gas. But, is still written into codes, which have never been updated.
Apparently in some cities and states black pipe does not need to be used for gas. I live in Chicago and black pipe is sold everywhere (city & suburbs) for the sole purpose of gas applications. This is confusing.
I don't know if natural gas causes a reaction with galvanized pipe or not, but traditionally black iron pipe is used for gas. Galvanized pipe is legal for water but is not a good choice at all. Generally copper is preferred for water although some new forms of pipe such as PEX is being used now. Black iron pipe is never used for water to the best of my knowledge.
These days black pipe is used for gas inside a building because it is cheaper. It has nothing to do with a reaction with the gas. Outdoors it has to be galvanized. Underground it is a black pipe with a coating, which is the poorest decision I have ever heard of, but then I am not one writing the code.