The Supreme court went by the spirit of the Constitution

The Supreme Verdict on Ayodhya Ram-Temple

Lord Ram is not only a religion deity for Hindus (specially for the practicing), he is also a cultural icon of this country.