Celibacy was a discipline long before Pope Gregory VII, some members of the clergy agreed to lex continentiae and then ignored it; refer to Canons XXVII and XXXIII from the Council of Elvira, 295-302 AD. Peter and Jesus speak about those who have given up everything, including wives, to follow Christ. Melchisedech, Elias, John the Baptist, Paul and Jesus, to name just a few, were celibate.
Celibacy dates back to the Apostles