Cultural anthropologists have spent no small amount of effort attempting to figure out why any particular group uses matrilineal vs patrilineal descent. Some work focuses on the influence of being primarily pastoral vs primarily agricultural. Pastoralists tend to be patrilineal and agriculturally predominant groups tend to be matrilineal. Given that variation among tribal cultures the simple explanation that one must know who the mama is, or limiting marrying out, seem untenable. The Israelites were however primarily agriculturalists.
Once again this aspect of identity has little to do with religion; it is about tribal identity, being a member of the tribe not just as a slang expression but in a very real sense.