First, to get it out of the way, it is not the case that 'Indian English is rhotic'. There is widespread variation - some speakers are and some are not (more details and references later).
But in explanation, there are multiple things going on here. There's the 'why' question, there's the 'r' question, and then there's India.
There are three kinds of answers to 'why' questions in linguistic phenomena.
it just happened (random drift). Why did the upper class accent in Southwest England in the early 19thc turn non-rhotic? Dropping r's ain't hard, they're pretty breathy consonants already. It may have just gone away all on its own. Sociologically, any kind of change can be an in-group marker, continued by the group to exclude outsiders. Of course the changes aren't totally arbitrary: a phoneme will drift into another more easily if it is nearby, t > d > th > 0, but not very often t > ng
Exposure to a different community. Why did the upper class accent in Boston become non-rhotic in the late 19th c? Probably to mimic the British accent (a sociologically desirable accent).
There's a documented case of one person saying something one weird way once and then everybody starting to follow. This is rare. Everybody started saying the solecistic 'My bad' (for 'My mistake') after the movie 'Clueless' popularized it (it existed before then but the widespread use came from the movie). This is rare to confirm, but may well be a non-trivial source of changes in languages.
But these why answers are somewhat conjectural and because of lack of ancient source material, phonological ones are hard to pin down unless there's datable poetry with rhyming for scholars to match up.
Asking about 'r' is extra interesting because there are so many varieties of it: a tap, a retroflex, a lateral, a trill, a velar fricative, a coloring on a vowel (all of which can drift in different directions according to tongue position). And becoming non-rhotic has many flavors, sometimes having intrusive or linking r's, sometimes one, and sometimes neither.
Asking about India and Indian English is complicated because India is kinda a big country, with many highly populated local standard languages (Hindi, Bengali, Telegu, Tamil, etc, etc, etc) each with different phonological systems, though it does have some Sprachbund characteristics. See The effects of native language on Indian English sounds and timing patterns
And then there's the English colonization, which in no way replaced any languages in India but, to oversimplify, the Indian variety of English became a lingua franca, a language of higher education/business, but such crossover languages aren't necessarily homogeneous, with prestige and colloquial versions. And then also it is who one is listening to, people in India, immigrants to the UK or to the US or media from different places.
Oh, and also English itself is complicated enough. It has rhotic and non-rhotic varieties. American, Scots, Irish, Wessex are rhotic, and English colonists may have taught English to Indians rhotically 150 years ago, or maybe the overwhelming number of American Youtube videos are teaching them now.
So to combine these all together, it's all one big caveat. There's no single Indian English, r's are different among the local standard languages plus non-rhoticity, there may have been some imitation of the RP r-dropping as well as a tendency to be rhotic or non-rhotic from the local standard. In the New Delhi area, one study (Postvocalic (r) in urban Indian English ) shows that there's a good mix of rhoticity versions. The study breaks it all down by many factors, in each group there's some people that are rhotic, sone not, tendencies in one direction or the other, but no 100% percent either way.
If there is a particular IE accent, say of Punjabis in SW England or bank clerks in Hyderabad, then one might be more specific. In the first example, Punjabi is rhotic (with a postvocalic r being a tap). So if they are r-dropping in English then it is probably an imitation of RP (or Estuary which is also non-rhotic).
At this point, you're probably wondering why I don't just answer what you know I think you're asking about, the stereotypical Indian speaking English, like Maz Jobrani or Apu on the Simpsons. Actors are pretty good at imitating
others, but they're not perfect, they're just making up stuff. They're just not particularly trustworthy.
On the English Dialects Archive there are 17 instances of Indian English, and my (rhotic-ear biased) survey showed only 2 of those were rhotic. But it could be that those were not reflective of the generic IE accent that you're thinking of. And as far as it goes, in Indian media (movies or news produced in India with Indian actors, speaking non-dubbed English) I personally hear strong non-rhoticity ('here' - /hjaw/, 'nurse' - /nʊs/,/nɜːs/)