Twitter is in an incredibly convoluted ideological war with the Indian Govt.

Monetarily and by pure numbers, the Indian right wing benefited from a new megaphone in twitter in 2014. Twitter only took notice of this after what they saw as the victory of a 'fascist' govt. (This is before twitter erupted into complete ideological polarization in 2016)

Looking at the readiness of getting blue check marks and twitter's general ideological tilt, twitter employees see themselves as ideological warriors defending the left wing in India. Twitter (either due to malice or incompetence) is known to favor the Indian opposition through its fact checkers, whom it signal boosts and the kind of news that gets marked as 'misleading'. A lot of my rather reasonable right-leaning acquaintances have gotten repeatedly banned off twitter, which to me does point towards a strong ideological bias on the platform.

Note that Twitter has only about 20 million Indians registered on the platform. That is a paltry sum given the size of the population. This means that most news about India on twitter is either by a very small set of west aligned Indians or folks who genuinely live outside India. Given that, I will entertain the possibility that the left wing bias of twitter is a consequence of the demographics who occupy it, rather than deliberate action by twitter. However, their actions towards the right wing in the US make me think otherwise.

When it comes to the law itself, twitter had been non-compliant for a while. But, the Govt. was stuck in a catch 22. Twitter remained the biggest platform for Modi to reach out to a 'global' population. So, the ruling party still feels like Twitter (despite it's best efforts to the contrary) might still be a useful tool for their politics. This makes it hard to ban twitter, because Modi doesn't want to appear like an authoritarian to the west. (for a counterexample, tiktok was banned due to the lack of these complicating dynamics)

Similarly for twitter, the capitalistic push is to expand further into India, which means expanding into a more modi-favoring and right-leaning population. On the other hand, the ideological push seems to be towards playing the martyr and getting banned in grand fashion with prime moral signalling in their favor.

Time will tell how this pans out, but Twitter is certainly not acting like a savior of free speech (and probably never has). Similarly, the Govt. while fully lawful, is using the laws in ways that benefits them politically (as almost all political bodies do).

From a legal perspective, I am glad to see Twitter comply with India's rules. For a while, it did seem like a foreign capitalistic body that was denying India's sovereignty because it felt it had too much leverage. At the same time, I do hope Rahul Gandhi falls in a ditch soon, so that the politically left bodies in India can elect a half decent leader who can mount a proper opposition instead of twiddling his thumbs on twitter.

People forget that Modi is democratically elected and has allowed the democratic electoral process to work under his regime. I disagree with a lot of his policies (social and economic) but the electoral process shall hold him accountable. Our Supreme court is also independent, so any outright violation can be addressed by twitter in the courts. Given that, Indian laws are an entirely internal matter and a foreign body like Twitter should abide by the laws of the land.

Last point: Correct me if I am wrong, but the Indian Govt. has yet to ask for any egregious censorship on twitter. Most cases are of removal of misinformation, selective use of fact checks and custom tags. Ofc, I am giving another perspective towards this issue. The rest of the comments do well to cover the rest of the rather valid perspectives.