It was done by a series of papal commands issued in the Middle Ages to stop the clergy from establishing a new hereditary kleptocracy. Priests, especially bishops, were accumulating substantial wealth by in effect taking it from the church, converting it into their personal property, and then leaving it to their offspring. They had begun attempting to will their positions in the hierarchy just as they were that property. Both presented a growing threat to the ability of the popes to control the institution, and so in the eleventh century Benedict VIII banned new marriages in order to illegitimize priests' sons so they could not legally inherit. Daughters, who under the law of the time could not inherit property anyway, were still recognized as legitimate until Gregory VII, toward the end of that century. He not only withdrew recognition from them, he actually annulled all clerical marriages that then existed, a pretty extreme measure but one he though necessary to rein in the piratical bishops.