The roof of the mouth hurts when you eat because it can be easily disturbed. The mouth is sensitive and often in contact with foreign substances (food, drink, that packet of chips you rip open with your teeth, etc.), so some of them are due to react negatively to the body. Aggravation of the roof the mouth could be caused by the appearance of sores, which sometimes appear in the palate and develop a burning sensation. The pain could be more obvious when you just woke up since your mouth is drier, eating spicy food and even snoring. Food that are irritating to the flesh might hurt is easier. Think ice cubes which have corners that might scratch the tissues. Spicy foods and food with extreme cold or heat can damage the mouth as well, swelling might occur as such. Tobacco could discomfort the roof of the mouth as well. Try to alter your diet to avoid food that could agitate your mouth. If you are feeling the pain, then stick to food that are relatively bland and at room temperature to let it heal naturally.