Each C=O bond is polar with O pulling the electrons towards itself. Since you have to identical AND opposing forces, the effects cancel, and the result is a non polar molecule of carbon dioxide. The same cannot be said with the bent molecule of water. The forces do not cancel because water is not a symmetric molecule.
Is carbon dioxide a nonpolar covalent bond?
A polar covalent bond is an unequal sharing of electrons between two atoms with different electronegativities (χ). However the dipoles in the linear CO2 molecule cancel each other out, meaning that the CO2 molecule is non-polar. The polar bonds in the bent H2O molecule result in a net dipole moment, so H2O is polar.