For the other ban, the fact that he called it a "muslim ban" and the specific countries that were picked is what made it racist and ineffective. It's hard to claim it's for security when they didn't include UAE, KSA, Egypt or Lebanon where the 9/11 hijackers were from [0]. It also happened to exclude all muslim countries where Trump has business in.
So yes, it had no other purpose than being racist. Just like Trump didn't really care to use the time bought by the Chinese travel ban to actually develop tests or ramp up PPE. It always was a show rooted in xenophobia.
Joe Biden called it "hysterical xenophobia and fear mongering [against] science." Pelosi was on the ground in San Fransisco's Chinatown with similar words. Maxine Waters too, though she had been talking that way since 2015, predicting every possible racist act.
If every politician did it, it must be easy to find a clip.