How does the Supreme Court balance religious practices of public officials with the secular nature of the Indian state?

I am curious about the principles and challenges involved when public officials, like the Prime Minister, participate in religious ceremonies. How does the judiciary ensure that such acts do not compromise the secular character of the state?