Kinship was crucial in ancient tribal societies, not just among the Israelites. According to Gabriel Andrade in The Transformation of Kinship in the New Testament
In the sphere of kinship, the Old Testament and Ancient Judaism
present great similarities with the rest of ancient religions. Ancient
Israel’s social organization is typical of many ancient societies: the
society is differentiated among twelve “tribes,” each claiming a
common ancestor. Apart from their common monotheistic faith, the
Hebrews appealed to kinship in order to hold together their national
identity: they all descend from Jacob. Kinship is the core of most of
their daily activities, their political organization and territorial
distribution.
The pattern of seeking wives among close relatives continues throughout Genesis.
- Abraham marries his half-sister Sarah
- Isaac marries his cousin Rebekah
- Jacob marries his cousins Leah and Rachel
- Esau causes grief to his parents when he marries two Hittite women and then tries to rectify the situation by marrying his relative, a daughter of Abraham's son Ishmael.
For Abraham, the feeling of being separate and unrelated to his neighbors persisted for decades, even after the death of his wife Sarah:
Abraham rose up from before his dead, and said to the Hittites, “I am
a stranger and a sojourner among you; give me property among you for a
burying place, that I may bury my dead out of my sight.” (Gen. 23:3-4)
It would only be in the time of Jacob that Israelites finally began to intermarry with God's apparent blessing, when Judah matched his son to the Canaanite Tamar (Gen. 28). She eventually became the mother of the key tribe of Judah. In the same generation, Jacob's son Joseph married Asenath,the daughter of an Egyptian priest (Genesis 41:45). She became the foremother of the key northern tribes of Ephraim and Manasseh.
The issue of idolatry does figure in the question, but in Tamar and Asenath's cases the traditional understanding is that they adopted the monotheistic customs of their husbands. Thus the reason Abraham insisted on Isaac marrying within his clan is that in those days, kinship was crucial.
Even in Jacob's time, the Israelites did not find a safe home among their neighbors. The Bible tells us that they eventually emigrated to Egypt and were enslaved there.
They would remember their time as strangers even when they finally entered the promised land for good:
And you shall make response before the Lord your God, ‘A wandering
Aramean was my father; and he went down into Egypt and sojourned
there, few in number; and there he became a nation, great, mighty, and
populous.' (Deut. 26:5-7)
The stranger who sojourns with you shall be to you as the native among
you, and you shall love him as yourself; for you were strangers in the
land of Egypt: I am the Lord your God. (Leviticus 19:34)