I got headache which I only felt on right of the head. And the pain seems to spread till neck. But only on the right side. Why?

A few reasons. Common migraine headaches are mostly unilateral, and may be persistent on only one side. However, some headaches may be associated with jaw problems, focal dental or sinus issues, and, if you were older, perhaps cervical or giant cell arteritis issues. Best to get evaluated by your doctor.
Anything. Headaches can come from fatigue, sleeping too much or too little, sleep apnea, snoring, being dehydrated, having chronic sinusitis or allergies, too much caffeine or over the counter headache medication, high blood pressure or something more serious like a tumor. If you sleep on your stomach you could be pinching a nerve in your neck. See your doctor and get checked.