Now, in Olivia Custer's entry titled "Sex" in the 750-page 2014 book titled The Cambridge Foucault Lexicon, edited by Leonard Lawlor and John Nale (Cambridge University Press; paperback ed., 2020; pages 449-455), Custer notes that the first volume of The History of Sexuality in French (1976) was subtitled The Will to Knowledge. This French subtitle clarifies the overall movement of Foucault's thought in volume 4, as he moves to his detailed discussion of Saint Augustine, bishop of Hippo (esp. pages 191-285).
For a relevant historical study of the conceptualization of the will in Western culture, see Vernon J. Bourke's book Will in Western Thought: An Historico-Critical Survey (New York: Sheed and Ward, 1964).
Incidentally, the American Jesuit James Bernauer in philosophy at Boston College also contributed relevant entries to the 750-page 2014 book The Cambridge Foucault Lexicon on "Christianity" (pages 61-63), "Confession" (pages 75-79), and "Religion" (pages 429-431).
In any event, the practice of confession in the context of ancient Western monasticism undoubtedly influenced the larger Western Christian practice of confession. In volume 4, Foucault hints that the theoretical framework of "the sexual ethic of [ancient] Western Christianity" "will be the starting point for the next study" in The History of Sexuality series, a next study that Foucault did not live to draft. In addition, in Volume 4, after Foucault discusses Saint Augustine, the bishop of Hippo, at length, Foucault also hints with the words "as we'll see" (page 284) as to what he plans to cover in subsequent volumes of The History of Sexuality, implying that he plans at least one further volume about medieval Western Christianity before and leading up to the volume of sexual ethics in the sixteenth century that he claimed he had already drafted - which would coincide temporally with the Renaissance. But your guess is as good as mine as to whether Foucault's draft of sexual ethics in the sixteenth century will ever be published. But my guess is that it will not.
For an account of the subsequent medieval history of the "catastrophic" (to use Cardinal Marx's term) valorization of virginity in the ancient Western church, see Dyan Elliott's book The Corrupter of Boys: Sodomy, Scandal, and the Medieval Clergy (University of Pennsylvania Press, 2020).
For an exploration of contemporary priests who do not maintain priestly celibacy, see Frederic Martel's book In the Closet of the Vatican: Power, Homosexuality, Hypocrisy, translated by Shaun Whiteside (London and New York: Bloomsbury Continuum, 2019; orig. French ed., 2019).
(Note: You can view every article as one long page if you sign up as an Advocate Member, or higher).