It's not racism. There are a bunch of pics of him praying to Hindu gods. There's appreciating a culture and there's just being weird about it.
This isn't quite right...
There's an enormous amount of problems that tinges Indian and Canadian relations, most of it from the Indian side. To elaborate: relations have never been
great. Relations were good in the 1950s and 1960s, with Canada providing a significant amount of foreign aid and technical support in India's development. That, however, came to an end when India got their hands on nuclear material by stealing from peaceful nuclear reactors provided by Canada in the 1970s. Those nuclear weapons leaked almost immediately afterwards to Pakistan, inflaming the situation. Food aid, loans, technical and nuclear support ended at that point and relations almost immediately froze solid.
Since then, relations have
improved, but never been
great.
A major flash point has been acceptance of minority groups from India as immigrants into Canada. In the 1970s and 1980s, Canada was a major destination for numerous groups, but, most notably, Sikhs fleeing violence in India and seeking better economic opportunities. Ethnic violence spilled over among the Indian diaspora in Canada based on ethnic/religious conflicts in India and culminated in the Air India Bombing of 1985 which killed 329 people, the vast majority of them Canadian citizens. In 1986, a Canadian cabinet minister of Indian ancestry was nearly assassinated by a Sikh extremist that had been effectively exiled from India. Anti-terrorism has, as such, been a major component of the relationship between India and Canada.
Relations started improving again after ethnic conflicts calmed down in the 1990s, but they've cooled off in recent years. Relations are often characterized as 'warm', but distant. Relations could be closer, and a lot of international experts are mystified why they aren't closer. Some of this is definitely Canada's fault, but a lot of blame falls on the current Indian government as well. They've been pursuing various Hindu-first policies, displacing and attacking religious and ethnic minorities in favour of a new, constructed Hindustani Nationalistic Identity. The current Indian government is, at times, and not without foundation, accused of fascism. This has done bad things to the numerous non-Hindi minority groups in India and they're facing serious persecution.
This has caused problems in relations because Canada thinks highly of the various minority groups that came over from India, most notably the Sikhs. Sikhs are enormously over represented in Canadian life; they make up 1.4% of the population, 6.2% of all Members of Parliament and 11.4% of major Cabinet level government posts and the (current) leader of the NDP (leftist party, traditionally 3rd largest) is a Sikh. This causes serious friction with India because their current Hindu-first policies are creating a lot of resistance, particularly among Sikh nationalists. India wants Canada to repudiate and marginalize Sikhs at higher levels of government, which isn't going to happen.
I'm going to give Trudeau a bit of credit here he may not deserve. I have a feeling, specifically, that going to various Hindu temples was supposed to be a conciliatory gesture. Hindu nationalists/religious extremists and imported ethnic violence have been the major sticking point in preventing India-Canada relations from becoming closer and he knows that. Making a gesture to appease them will hopefully, change 'warm but distant' relations, to simply warm relations.