To keep them separate as they were shepherds, which were an abomination to the Egyptians (Gen 46:34)