The reason is that cold irritates the upper palate, responsible for the nerve nodes transmitting sensations to the brain.
The blood vessels respond to cold by constricting or expanding, resulting in pain. When you feel cold, your body sends warm blood to the cold spot, which causes pain.