The bench also said that several temples were demolished in the past after being identified as encroachments