According to https://en.m.wikipedia.org/wiki/Ancient_Canaanite_religion#Cosmology and https://en.m.wikipedia.org/wiki/Sacred_prostitution#Sacred_marriage, a deity would marry a city or a goddess would be said to be married to a king. But I can't seem to find how and why such beliefs emerged. What was the reason that caused the belief of a sacred marriage between a god and a city? Why would people start saying a king is married to a goddess?
From The Bible when the disobedient spirit sons of God (angels) materialised human bodies and took human wives for themselves and produced hybrid offspring called Nephilim (Giants):-
NWT Genesis 6:1, 2 "Now when men started to grow in number on the surface of the ground and daughters were born to them, 2 the sons of the true God began to notice that the daughters of men were beautiful. So they began taking as wives all whom they chose.
The result of the unnatural union, spirit beings & human beings, was:-
NWT Genesis 6:4 "The Nephilim were on the earth in those days and afterward. During that time the sons of the true God continued to have relations with the daughters of men, and these bore sons to them. They were the mighty ones of old times, the men of fame."