Joseph collected all the excess food in the land of Egypt during the seven years and stored it in the cities. In every city he put the food gathered from the fields around it.
But he did not purchase the land of the priests because the priests had an allotment from Pharaoh and they ate from their allotment that Pharaoh gave them. That is why they did not sell their land.