Discriminating based on caste is racism.
Actually, the Brits used the caste system to their own advantage* and discrimination based on caste didn't become outlawed until the Indian constitution was written post-independence.
Today it's widely understood that this was done to reward those who supported the British during the 1857 rebellion and to utilise caste-based segregation in British Indian army against any future rebellion.
Britain has had a very strong class system, which was perhaps at its peak around the time of the empire, so it would not have been a big leap at all to understand the Indian caste system.
It was going to be in relation to the British rule helping abolish it, but it's not completely gone still, is it? During travels through small towns in the western part of India, I heard about a local case around 2010, but allegedly the widow did it voluntarily, and without outside influence.
* https://en.wikipedia.org/wiki/Caste_system_in_India