I don't know if this is what the judges said or if it is the Guardian's spin on what they said. Either way, the Indian constitution has no separate guarantee for "freedom of the press."[1] Theoretically, the press has as much (or as little) freedom as the common man. Practically, the ability to openly blackmail all and sundry means they can say what they want without repercussions.
Further, Article 19(2) severely restricts any such right to "freedom of expression" for a variety of reasons, including national security:
> Nothing in sub clause (a) of clause (1) shall affect the operation of any existing law, or prevent the State from making any law, in so far as such law imposes reasonable restrictions on the exercise of the right conferred by the said sub clause in the interests of the sovereignty and integrity of India, the security of the State, friendly relations with foreign States, public order, decency or morality or in relation to contempt of court, defamation or incitement to an offence
In a twist of irony, Jawaharlal Nehru, former prime minister and the great-grandfather of the Rahul Gandhi mentioned in the Guardian article is responsible for this curtailment of rights. He could not run his socialist regime in peace if there was absolute freedom of speech and expression.
I am sure there is some law somewhere which allows the Indian government to spy on its citizens. After all, there are hundreds of British-era laws still on the books. The only question is whether such spying is "reasonable."
There, I would prefer to give the benefit of the doubt to elected representatives. I am not in favor of handing over veto power over executive decisions to judges who are not only unelected, but probably unique in any democratic country to have reserved the power to select their own replacements. Imagine the US Senate twiddling its thumbs while US Supreme Court judges selected not only their own successors, but also every single judge in the federal judiciary.
[1] Article 19(1) (https://indiankanoon.org/doc/1218090/)