Yes, a team should be penalized if their fans use slurs at the World Cup, because then the fans would be more considerate. Holding it against the team that the people are supporting would be the only way to control the behavior of the fans. The World Cup is about bringing people together, and we should be civil.
Imagine a person at a basketball wearing a laker shirt throws a cup of beer and yells an insult.. The lakers win but the nba says game doesn't count and if it happens again they don't make the playoffs? Guess what a non fan wears a laker jersey and does it and now the lakers aren't going to the playoffs. This makes no sense and has an obvious flaw..Anybody can wear any jersey and do anything to hurt the team..Fans or not.
While the amount of overt racism that exists in soccer is completely appalling, I don't believe that the team should be punished for their fans. They have no control over what their fans do or say so I believe it would unethical to place the blame on them. I think the individual fans should be fined and kicked out of the game.
Using slurs and racial insults shows a profound lack of cultural sensitivity, and this is something the team cannot control. It would be better to set an example by promoting clean insults and racial harmony from the team, but it's ultimately the fans who are at fault here, not the team at all.
The players on the field should in no way, shape or form be penalized for what goes on in the stands. The players have to put forth so much effort before and after the game that it would be an absolute crime to see them lose it all because of some racist fan.