When Pope Benedict XVI resigned the papacy in 2013, he vowed to live the rest of his days in seclusion, to serve the Catholic Church “through a life dedicated to prayer.” But the church’s spiraling abuse crisis prompted him this week to ­return to the limelight.

The retired pontiff has drafted a 6,000-word document in his native German and aims to publish it in a monthly periodical for clergy in his home region of Bavaria. Benedict says the document, an English translation of which I’ve reviewed, is meant to assist the Church in seeking “a new beginning” and making her “again truly credible as a light among peoples and as a force in service against the powers of ­destruction.”

In the preface, he makes it clear that he is “no longer directly responsible” for the church and that he consulted Pope Francis before ­resolving to make the document public.

Nevertheless, Benedict’s “The Church and the Scandal of Sexual Abuse” has the unmistakable ring of a papal document. You might even call it a post-retirement encyclical.

It’s written with his signature precision and clarity of insight and offers a piercing account of the origins of the crisis and a ­vision of the way forward.

The church’s still-radiating crisis, Benedict suggests, was a product of the moral laxity that swept the West, and not just the church, in the 1960s. The young rebels of 1968, Benedict writes, fought for “all-out sexual freedom, one which no longer conceded any norms.”

Benedict adds: “Part of the physiognomy of the Revolution of 1968 was that pedophilia was now also diagnosed as allowed and appropriate.” This might strike contemporary readers as puzzling. But those who lived through that wretched decade will remember that some of the leading ’68ers also advocated “anti-authoritarian education,” which involved some pretty ­unsavory interactions between adults and children. Hippie communes weren’t child-friendly places, either.

“I have always wondered how young people in this situation could approach the priesthood and accept it, with all its ramifications,” Benedict writes. “The extensive collapse of the next generation of priests in those years and the very high number of laicizations were consequence of all these processes.”

The church, in other words, was no more immune to the disorders of that decade and its aftermath than the rest of society.

How come? Benedict blames clerics and theologians who, in the ­aftermath of Vatican II, abandoned natural law — the notion that morality is written into ­human nature itself and can therefore be grasped by human reason — in favor of a more “pragmatic” ­morality.

Under the new dispensation, “there could no longer be anything that constituted an ­absolute good, any more than anything fundamentally evil; there could only be relative moral judgments.”

The real world result was that “in various seminaries, homosexual clubs were established, which more or less openly and significantly changed the climate in seminaries.”

The new morality also encouraged a “critical or negative attitude toward hitherto existing tradition,” he writes, in favor of a “new, radically open relationship with the world.”

For one bishop, the German pontiff says, that meant going so far as screening porn for seminarians. In many seminaries, meanwhile, students caught reading his own books, written while he was still a cardinal and known for their doctrinal rigor, would be “considered unsuitable for the priesthood.”

The looseness of those years also affected how the church ­handled cases of abusive priests, who we now know targeted mostly boys and young men. In church proceedings, “the rights of the accused had to be guaranteed” above all else, “to an extent that factually excluded any conviction at all.”

Such absolutism in defense of the accused was ­incorrectly seen as a “conciliar” requirement — anything less was a betrayal of Vatican II. Hence the cover-ups and shuffling around of abusive priests.

It’s impossible to miss Benedict’s bitterness toward what he sees as distortions of Vatican II, a council he helped shape as a young theologian.

So what is to be done now? Benedict recommends reforming church law, to give as much emphasis to protecting the faithful, not least the faith of ordinary Catholics, as to safeguarding the procedural rights of accused priests. But no amount of procedural reform, the pope notes, can substitute for the recovering Catholicism’s absolute moral standards. “Why did pedophilia reach such proportions?” he asks. “Ultimately, the reason is the absence of God.”

Yet he ends on an optimistic note: “Yes, there is sin in the church and evil. But even today there is the holy church, which is indestructible.” Amen.

Sohrab Ahmari is The Post’s op-ed editor.