The by product of using hydrogen as a fuel is water, but unless every drop of water used to make hydrogen is replenished with absolutely no loss of hydrogen, than using it as a fuel in the long term would be far more harmful to the planet than burning fossil fuels.
Hydrogen fuel cells power the shuttle's electrical systems, producing a clean byproduct - pure water, which the crew drinks. A fuel cell combines hydrogen and oxygen to produce electricity, heat, and water.