Why does putting a cloth over a canteen help it stay cool?

A cloth on a canteen helps cool the canteen only if it is kept wet.

When water evaporates what it is doing is changing state from a liquid state to a gaseous state. The water doesn't change temperature at all but it requires the addition of heat to change state. That heat is called the latent heat of vaporization. The latent heat of vaporization for water is 1060 BTU/lb. That is quite a bit. When the water in the canteen cover evaporates it has to draw heat from somewhere. It draws it from the canteen skin which, in turn, gets it from the canteen contents, and cooling the contents.

If the canteen cover dries the process stops and heat flows in the other direction (from hot to cold). The cover probably provides a little insulation value, but not very much.

Check this out. You might find it interesting. Fifty years ago it was not unusual to find something like this hanging from a front bumper. It looks like they are still available.