The Tribe of Levi was not to have an inheritance in the land of Israel among the other Tribes. This is not to say that the Levites had no place to live; they were given a number of cities, scattered among the other Tribes. (This also fulfills the patriarch Jacob's deathbed prophecy that the Tribe of Levi should be scattered - see Genesis 49:7. For the record, the Tribe of Simeon likewise had non-contiguous real estate, as per this verse.)
The reason for this mitzvah is that the Leviim are designated to officiate in the Temple, in exchange for which they receive tithes. God has told the Levites that He is their portion, to the exclusion of real estate (see Ezekiel 44:28).
This mitzvah is an excellent rebuttal to cynics who have historically claimed that Moshe “made things up” to favor his Tribe. (God forbid!) If such a thing were conceivable, wouldn't he give his own Tribe tithes in addition to real estate rather than instead of it? Logically, a human being practicing nepotism would not exclude his own kinsmen from inheriting a share in the land. An objective third party, however, would quite logically exchange a territory for tithes.
This mitzvah applies to Levites at a time when the land is settled by the nation. In the Talmud, it is discussed in tractate Baba Basra on page 122a-b. It is codified in the Mishneh Torah in the thirteenth chapter of Hilchos Shemittah. This mitzvah is #169 of the 365 negative mitzvos in the Rambam’s Sefer HaMitzvos.