In the case of water, the intermolecular force is hydrogen bonding. Hydrogen bonding is a dipole-dipole interaction that occurs between a hydrogen atom covalently bonded to a highly electronegative atom (such as oxygen, nitrogen, or fluorine) and another electronegative atom. In water, the hydrogen atoms are covalently bonded to the oxygen atoms, and the oxygen atoms are highly electronegative, creating a strong hydrogen bond between water molecules. These hydrogen bonds create a network of interactions between water molecules, requiring more energy to break them and turn water into a vapor, resulting in a higher boiling point.
On the other hand, carbon dioxide molecules are nonpolar, meaning they do not have a significant dipole moment. The intermolecular force between carbon dioxide molecules is London dispersion forces, which are weak van der Waals forces arising from the temporary fluctuations in electron distribution. London dispersion forces are much weaker than hydrogen bonds, so it requires less energy to break them and turn carbon dioxide into a vapor, resulting in a lower boiling point.
Therefore, the stronger hydrogen bonding in water compared to the weaker London dispersion forces in carbon dioxide is what causes water to have a higher boiling point than carbon dioxide.