Final answer:
Secular rulers, kings, and princes violated Pope Gregory VII's ban on lay investiture by appointing and controlling church officials in their lands, going against the church's claim that the pope held the power to grant kings their positions.
Step-by-step explanation:
The violation of Pope Gregory VII's ban on lay investiture was primarily done by secular rulers, kings, and princes who sought to control the churches in their territory and reject the authority of the church. These rulers insisted on their right to appoint and control church officials in their lands, contrary to the church's claim that the pope held the power to grant kings their positions.
This conflict between the church and secular rulers led to a power struggle known as the investiture controversy in the 11th century. Pope Gregory VII banned the practice of simony, which involved the selling of church offices, in 1075. When Holy Roman Emperor Henry IV continued to appoint bishops and engage in simony, Gregory excommunicated him and declared his rule illegitimate, leading to a rebellion by German princes against Henry.