I'm not a fan of the Indian government's tendency to behave like a nanny state over the past decade by arbitrary filtering/banning content on the internet. I'm not a fan of a lot of things that the Indian government does or how it goes about doing them.
As far as tiktok, there are plenty of reasons to ban it and there are plenty of reasons not to, though it seemed more reactionary than well thought out.
I don't think nuanced decision making is a strong suite of Indian government when it comes to technology especially censorship(VLC was blocked for god's sake) in direct contrast to how well it seems to be executing the India stack at scale.
The Indian people and government are furious with china's flouting of the agreed upon status quo at the border and it comes with all the nationalistic fervour that fury entails. It has also eroded india's trust in china at a diplomatic and military level.
India has been trying to counter and contain china's influence in the region with limited success and all of India's politcal, diplomatic and military institutions see china as our biggest threat.
The nuance in the "bugbear" thing is that this accelerated re-orientation against china is not coming from a place of fear, it's coming from a place of "Come at me bro".
While on paper it might seem like India is militarily outmatched by china the geopolitical and tactical reality is that china is incapable of mounting a meaningfully successful attack against India without itself suffering politically, militarily, economically and diplomatically.
I agree with you and as does anybody with even a passing familiarity with international diplomacy, foreign policy by its very nature is about engaging with other countries to further a nation's self interests.
The problem is western democracies need to create a narrative of being the white knights of the world in order to justify use of force, coercion or influence to their people no matter how hypocritical that narrative might be considering their own actions in the past. This absolute narrative by extension also means anyone who isn't falling in line with the party line is painted as being on the "wrong side of history".
India is neither aligned with the west nor russia because of a single policy issue like china, and india does not see the world as a bipolar place like west vs russia, west vs china, whoever vs whoever...
India always engages and will always engage with nations where mutual interests are aligned, help where it can, and be assertive where it needs to be.
India is already aligned with the west in containing china amid other common objectives in the indian ocean through QUAD.
Also china isn't that big of a bugbear for india as some outside india think it is. China is the dominant strategic regional threat but is by no means even remotely close to an existential one.