What is the meaning of [where God builds a church, the devil will build a chapel]

Any force for good, such as progress or reform, is inevitably accompanied—or closely followed—by something bad; not exclusively used in religious contexts.