It's currently illegal for NASA to work with China. There's been a line in the NASA appropriations bills for the last 5 years or so saying none of the money they're receiving can be used bilaterally or in cooperation with China
That describes the mechanism, not the rational.
How about working with Taiwan? I think they too have a space program, although I have no idea how big it is.
"The 'One China' policy is not a card on the bargaining table," said Paul Haenle, a former China director at the U.S. National Security Council. "It is the table itself."
Speaking of significant political differences, NASA has been partnering with Russia and nobody seems to have a problem with that.
It's not necessarily the case that nobody has a problem with it, it's just the status quo, and the front lines of most political issues are on one side of the status quo or the other. The "don't work with China" side would push across to "stop working with Russia" if they had the strength to.
They should be... sadly, the political reality often gets in the way of idealism.