I think I would have said something like, "Not all people from India are Hindus. There are people of many different religions in India, including Christians, Muslims, Buddhists, etc.. Only the Hindus wear the pottu." You kind of got into that in your last line, but that was right before you gave up on the conversation.
I think it's hard to tell from text whether he was joking, serious, kind of joking but also didn't really know, etc.. I think a clear, factual response that tried to get at the heart of the perceived misconception would have been a good move, as it would clear up his confusion if it was real, or tell him that you didn't get what was supposed to be funny if he was joking. Kind of like "not getting" an offensive joke, thus putting the teller on the spot.
Don't take this to mean that I think you did anything wrong, just that it's an option for next time. Also I see nothing wrong with typing to someone, "Are you joking or serious? Sorry, I can't tell." His statements did kind of go off the rails.
Ah, don't you love text conversations, where you can reproduce them here accurately and we can all dissect them?