Why did the church oppose lay investiture?
Lay investiture describes the granting of religious offices by non-religious officials. This was fairly widespread in medieval Europe as kings or other powerful men would "invest" other laypeople with the trappings of religious authority. The Church opposed this practice because it tended to limit their authority in areas where many bishops had been appointed by kings. If lay (non-clergy) officials could grant these offices, they could control the people that accepted them, and this meant control over the Church itself. There also was considerable corruption involved in the dispensation of church offices, and many reformers sought to end the practice on these grounds as well.
One instance where this issue was especially heated was during the eleventh and twelfth centuries, when the Holy Roman (German) Emperor Henry IV, notorious for abusing the power of lay investiture, saw this power stripped from him by Pope Gregory VII. After a protracted dispute, the Church emerged victorious, and the Emperor's power was considerably weakened. The issue was an important one for papal authority, and the struggle over lay investiture continued over the next two or three centuries.