You Heard WRONG.
It is amazing how erroneous rumors get started.
Not only is Galvanized pipe legal it is specified in many OUT DOOR localities.
The reason plumbers don’t use galvanized pipe is because it cost more then black steel same reason they wont use brass piping.
The problem that a lot of plumbing inspectors had with the use of galvanized fittings is that the zinc coating on the black fittings may possibly hide a defect in manufacture like a pin hole.
But this has nothing to do with the piping itself.
When gas piping is exposed to the elements like roof units it is common decency to use this material as opposed to black pipe and fittings which must be protected with red lead and other coatings to prevent rust.
When in doubt why not look to the local codes or the NFPA and or AGA publications instead of listening to the bad advice you were given it would appear.