The court emphasised the need to ensure communal harmony in the area, which has witnessed tensions over a claim that a Hindu temple once stood at the mosque’s site