Some plumbers and the posts above suggest replacing galvanized pipes should almost always be done. In my case, I believe that SOME of the replacement was a mistake.
I replaced my galvanized steel pipes with PEX pipes. The old house I live in had galvanized drain pipes which were badly deteriorated. The entire drainage system required replacement.
The plumber indicated that it was just a matter of time before the other plumbing (also galvanized) failed. I accepted his suggestion to replace all plumbing.
When the water pipes were cut out, I found there was very little corrosion, even though the piping is over 50 years old. The one exception was the pipes from the valve to the shower head, which only had a ¼ inch hole (still adequate water pressure).
Wikipedia indicates the useful life for galvanized pipes is 50-70 years, copper is probably good for 70, too. PEX (rubber with cross fibers) are warranted for 25 years and probably good for 50 (Wikipedia), provided a rodent doesn’t chew them in two.
I concluded the issue relates to oxidation. The drain pipes corrode quicker because there is air in them. The water pipes have little oxygen because there is always water inside (an exception: from the valve to the shower head, where there is air).
Pipe corrosion has NO adverse health effects provided you have clean water (well systems can have minerals/lead).
Plumbers at supply stores told me they recommend replacement of: (1) drain pipes and (2) use PEX or copper piping from the main water lines to existing outlets.
There is an argument to be made to do everything at once (all materials at the site; maybe you can sell the house for more with “new” plumbing). But my pipes had a lot of wear left (only 5%-20% corrosion). I probably spent an extra $1,200-$1,500 that could have been delayed decades.