This is absolutely not true. Every public figure left of center in the country commented viciously about the racist, stupid travel ban.
If every politician did it, it must be easy to find a clip.
[0] https://en.wikipedia.org/wiki/Hijackers_in_the_September_11_...
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.
The official record is better, though. This bill calls out travel discrimination based on national origin: https://www.congress.gov/bill/116th-congress/house-bill/2214...