In The Amazing Spider-Man (2012), Dr. Rajit Ratha's role played by Irrfan Khan, which appear to me as an open-end character. Is his role similar to some Comic counterpart or is it kept to earn from the character's popularity? I mean the requirement of Indian/Asian character doesn't appear in the film. So what is the intention for this casting? And even, as per rumors, Irrfan Khan opted out to play any villain.
Unlikely. He has a pretty minor role in the first film, and his character's name doesn't match existing comic characters. The in-universe viral marketing website for Amazing Spider-Man 2 posted recently that his character was found dead. There was a deleted scene in the first movie that contained his death, so this post indicates it's canon for the sequel. It wasn't an open ended ending for his character in the first movie, the plot line simply got dropped.
In an interview a few years ago, he explains how he was cast:
The actor says he got 'Spider-Man' role after his appearance in US drama 'In Treatment' where he played a widower, who is trying to adjust to the life in a foreign land with his son and his American wife.
"The role got me some good reviews there and I think the industry there is aware of my work. Marc Webber had seen me and wanted to work with me and he approached me for this role. I play one of the villains in the movie. It is a pivotal role."
io9.com mentioned another possible reason for his casting:
[Amazing Spider-Man] has broken box office records in India, possibly partly because of Khan's supporting role.