I normally agree that sport should be left out of politics. However, in ancient Greece warring factions would agree to a ceasefire in order to participate in the Olympics. In this case, Ukrainian athletes are unable to participate in several cases due to Russia's illegal invasion. It would be incredibly poor optics to allow Russian athletes to travel the world freely and compete for their country while their government prevents competitors from Ukraine to do the same.
Further, in an effort to avoid all out physical war, countries are attempting to end this as peacefully as possible. Excluding and embarrassing Russia, including through sport, is part of that effort. Banning Russian sports teams and athletes actually is an attempt at peace.