Mostly at least, it's because it makes it more difficult to get rid of heat.
Lets simplify things by assuming that sweat is just water. The individual water molecules will have a variety of energies. They will absorb heat energy from your body to become more energetic (and hotter). The most energetic of these molecules will leave the liquid, making the sweat that is left over cooler.
Air can only hold a certain amount of water molecules, however. If the air already has a lot of water (in other words, it is humid), the energetic water molecules in your sweat won't have anywhere to go, and sweating won't cool you off.