The notion of holiness, or ‘qadosh’, literally means “to be set apart.” In claiming the Israelites as His own, God “set them apart from the nations” (see Lev 20:26).
Were the Israelites ready to be “set apart”, though, or to be holy for the Lord, when they escaped slavery in Egypt? No; so, God set up provisions in the Mosaic law that were meant to help them keep themselves ‘apart’, so that they wouldn’t be swallowed up by the practices of their neighbors. As we can see, in many Biblical stories (e.g., the effect on Solomon of his many foreign wives), the Israelites failed to live up to this command.
So, it’s not as if they’re ‘aloof’ out of unkindness or malice; but rather, they were to be set apart as a sign of their identity as God’s chosen people.
Does that help?