(Bamidbar 26:53) "To these shall the land be apportioned as an inheritance according to the number of names": I would understand that all are included — Israelites, Cohanim, Levites, proselytes, women, bondsmen, tumtumim (those of indeterminate sex), and hermaphrodites. It is, therefore, written (Ibid. 18:20) "And the L-rd said to Aaron: In their land you shall not inherit" — to exclude Cohanim. (Ibid. 24) "In the midst of the children of Israel they shall not have an inheritance" — to exclude Levites. (Ibid. 26:55) "By the names of the tribes of their fathers shall they inherit" — to exclude proselytes and bondsmen. (Ibid. 59) "To a man, according to his numbers, shall his inheritance be given" — to exclude women, tumtumim, and hermaphrodites.
R. Yoshiyah says: The land was apportioned to those who left Egypt, as it is written "By the names of the tribes of their fathers shall they inherit." What, then, is the intent of "To these shall the land be apportioned"? (To such as these,) to exclude minors (below the age of twenty). R. Yonathan says: The land was apportioned according to those who came to the land, as it is written "To these shall the land be apportioned."
And what is the intent of "By the names of the tribes of their fathers"? The L-rd changed this inheritance from all the inheritances in the Torah. For in all the inheritances in the Torah the living inherit the dead, whereas here, the dead inherit the living. Rebbi says: An analogy: Two brothers, Cohanim, were in a city.
One had one son; the other, three. They go to the granary (to take their portion.) The first takes one sa'ah; the others, three, after which they go to their fathers' father and share equally. R. Shimon b. Elazar says: The land was apportioned to these and to these.
How so? If they were of those who left Egypt, they took a share with those who left Egypt. If they were of those who entered the land, they took a share with those who entered the land. If they were both of these and of the others, they took a share of both — so that both verses are satisfied.