Even with human history, religious organizations are always corrupted thus novels basing on our reality portray these churches or any religious cult evil.
Religion can be a very powerful tool in controlling us humans, basicaly religion controls us by faith and belief. We follow laws, be fearful in committing sin against it and will naturally support it as if it's just meant to be. It is a control without violence and brainwashed consent.
In the end this tool is also something so easily corrupted, something that is worship/respected is given great power. Once this is blackened this is where it becomes evil. Lots of civilizations have fallen in history and religion plays a big part.
In conclusion, why temples in novels, webtoon, stories etc are corrupted is because they are merely based in our history.