Cotton shrinks in both hot and warm water because it is a natural fiber. Natural fibers are often combined using a loose weave in order to give garments more give. Looser weaves tend to tighten up and return to their natural state when they become wet.
Natural fibers, such as cotton, are slightly stretchy. When manufacturers create clothing from natural fibers, they use less fabric by stretching the fibers in the garments even more. Stretching the fibers allows them to save money by using less fabric. This is why garments constructed of natural fibers tend to shrink more when they are washed. There are preshrunk fabrics that are put through a special compression process to prevent the weave of the fabric from shrinking.