means that
outward displays of religious devotion do not necessarily reflect genuine faith or virtuous conduct.
Imagine a case where people that show an excessive religiousness, often are far away from true faith or virtue; then “The nearer the church, the farhter form God” fits well.