Other responses go into this in more detail, but basically there are a few very chemically different types of rocket fuel. Usually for main engines these are bipropellants, with a fuel component and an oxidizer component.
The expensive, exotic, high-specific-impulse, but low-density and dangerous option is liquid hydrogen + liquid oxygen (hydrolox), which does indeed create water vapor as exhaust. This particular rocket, however, uses RP-1 (similar to jet fuel - just highly refined kerosene) + liquid oxygen - still burning hydrocarbons, still releasing CO2, but favored because it's cheap, dense, safe, and doesn't need cryogenic cooling.
For comparison, the ITS (and many other Mars mission concepts) use liquid methane + liquid oxygen (methalox), which also outputs CO2, needs cryogenic cooling and is not as safe or dense as RP-1/LOX, but is still safer and denser than hydrogen, doesn't need to be kept quite as cold, and is easy to synthesize on-site on another planet.
The expensive, exotic, high-specific-impulse, but low-density and dangerous option is liquid hydrogen + liquid oxygen (hydrolox), which does indeed create water vapor as exhaust. This particular rocket, however, uses RP-1 (similar to jet fuel - just highly refined kerosene) + liquid oxygen - still burning hydrocarbons, still releasing CO2, but favored because it's cheap, dense, safe, and doesn't need cryogenic cooling.
For comparison, the ITS (and many other Mars mission concepts) use liquid methane + liquid oxygen (methalox), which also outputs CO2, needs cryogenic cooling and is not as safe or dense as RP-1/LOX, but is still safer and denser than hydrogen, doesn't need to be kept quite as cold, and is easy to synthesize on-site on another planet.