It's a fundamental flaw in the strategic AI if it doesn't consider the affect of temples and religions in its own empire. Perhaps it waits for the ideal time to knock down the temples and place its preferred one there, but then spends too much time in the brothel and forgets what it is supposed to be doing. Who knows.