The most common pipe material is copper, but it has the ability to leach into your water and therefore may be less safe for you to drink if the water has been sitting in the pipe for more than 6 hours. Concerns about lead-based solder are unfounded, as modern solders are lead-free.
Cross-linked polyethylene (PEX) piping has been shown to leach ethyl tertiary butyl ether, a mildly toxic chemical, and is permeable by other potentially harmful chemicals. Polyvinyl chloride (PVC) itself is safe, but some PVC glues contain dimethylformamide which is also toxic.
In all cases, leaching is only a major problem for water with high acidity.
PVC, PEX and other plastic piping use a manufacturing process that is highly toxic to the environment. More importantly, because of the chemicals used in their manufacturing, they can give off toxic gases if your house were to ever catch fire.
The manufacturing of copper piping is relatively clean, however there is some ecological impact of copper mining.
Copper is easily recycled, lessening its overall impact on the environment. PVC is not recyclable.
PEX is theoretically recyclable, but most recycling plants won't process it. PEX continues to have an affect on the environment in landfills, where chemical leaching can occur.