NEW DELHI — What are the ethics in choosing whom to follow on Twitter? Do influential people — say, a head of state — have a higher responsibility not to follow people who post hateful tweets?

That is the debate now in India after it was discovered that Prime Minister Narendra Modi, a hugely popular but divisive figure, was following the Twitter feed of a man who wrote the following this week, after a female journalist was shot to death: “One bitch dies a dog’s death all the puppies cry in the same tune.”

Many Indians were bothered by that message, then doubly disturbed to learn that the writer, Nikhil Dadhich, a prolific tweeter who describes himself as a “Hindu nationalist,” was among the 1,779 accounts their prime minister was following.

“The prime minister shouldn’t be doing that. He’s giving legitimacy to filth,” said Sai Krishna, a medical student in southern India who heard about the nasty message after the journalist, Gauri Lankesh, was killed Tuesday. The police have few leads, but many analysts said they believed the killing was an assassination.