In The Bridge of San Luis Rey, Brother Juniper and the Archbishop are both foils to the Abbess. The different ways they operate as religious leaders demonstrate the hypocrisies and virtues of the Catholic Church as it operates in colonial Peru.
Brother Juniper is so devoted to promulgating Catholic doctrine that he fails in his basic duties as a priest. He has been tasked by the colonial administration with converting indigenous people to Catholicism (historically, this happened by force, although the book doesn't discuss that here) and caring for their spiritual and material needs. Instead of doing that, Brother Juniper devotes his time to searching for logical proofs of God's existence—thus, his investigation of the bridge collapse victims. Besides making him look foolish, this behavior causes real harm to the people under his care: when plague breaks out in his village, Brother Juniper ignores his responsibility to care for the sick and secretly rates his parishioners on qualities like "piety" and "usefulness" in order to demonstrate rationally why God chose to spare some and kill others. Brother Juniper sees himself as a servant of the Church, but his approach leads him to unfeeling, even cruel, actions.
Meanwhile, the Archbishop is greedy, lazy, and selfish. The highest-ranking Catholic leader in colonial Peru, he cares only about maintaining his extravagant lifestyle and blatantly ignores his responsibilities, even when he sees priests exploiting the common people. Cultivating friendships with other powerful men like the Viceroy and telling himself that the poor are "insensible to misfortune" and thus unworthy of help, the Archbishop sees the church as a means of personal advancement.
By contrast, the Abbess rarely talks about theology and lives a simple, even austere life. Unlike these two male clerics, she sees the teachings of Catholicism as a mandate to serve others, and is totally focused on improving living conditions for Lima's poor, ill, and orphaned citizens. Her singleminded focus on this task is evident when Doña Clara visits from Spain, and the Abbess immediately asks what advancements that country has made in caring for its vulnerable populations. The Abbess is not without personal failings: she eventually recognizes her insistence that the institutions she's founded live on after her death as a form of narcissism and accordingly abandons that hope by the end of the book. Yet Wilder portrays her as living out Catholic ideals far more successfully than Brother Juniper or the Archbishop
The differences among these three characters help to develop the novel's thematic concerns with dogma and altruism. Brother Juniper is so obsessed with Catholic dogma that he's unable to live up to the church's more important moral teachings. The Archbishop ignores Catholic teachings altogether and uses the power with which the church has endowed him to enrich himself personally. Notably, the Abbess isn't unthinkingly deferential to Catholic institutions: She argues with the Archbishop and proposes far-seeing social reforms that others oppose. Instead of focusing on dogma, she uses her religious vocation to improve people's everyday lives. Although The Bridge of San Luis Rey contains many examples of hypocrisy among Catholic leaders, the Abbess's path shows that the Church is not entirely compromised and, when led by the right people, can be a force for good.