There is cognitive dissonance between what Indians have been taught in school, their culture, and reality. When reality and perception clash, reality always wins.
The fact is, most Indians are blacks, yet have been taught that white is right. That stems from both Brahmin oppression and British domination for centuries. Because of this, the ideology of the white man (British and Brahmins) is seen as absolutely correct, and anything that goes against it must be wrong. This is the typical slave mentality fit for cotton pickers.
However, this perception clashes with the fact that Chinese not only have lighter skin color, placing them higher in the Indian mental hierarchy, but the reality that China is superior to India in all ways. This leads to a conflict between the indoctrination that Indian Western democratic, religious and capitalist culture, which are derived from white European ones, is supposed to be superior to "inferior" Eastern, authoritarian, atheist, socialist Chinese ones. The fact of their inferiority leads them to lash out against China.