You need to hit two thresholds at once: at least $30,000 in cash and 40 or more towers on the board.
When you clear a round with both in place, a prompt appears asking whether you want the temple — it will cost you $30,000 and 40 towers, taken at random. Accept, and you unlock the Sun God, which has full-page accuracy and hits extremely hard.
One important caveat: this only works on the advanced track.
Hope that is what you were after!