Thermal structure of solar coronal holes and their magnetic fields unveiled