The idea of red for republican and blue for democrat really didn’t come about until the 2000 election, when those colors became standard for those parties, without any rhyme or reason behind it. Before the 2000 election, it was the network’s choice which colors represented which party. For example, the electoral map for the 1984 election will show 49 blue states, blue of course representing Reagan, despite his being a Republican. Party identification with colors was not even needed until the invention of color TVs, as those keeping up with the election before color TVs would not be able to tell which colors were used anyways. The choice of Red and Blue? There really isn’t any specific reason for those two colors. They could easily have been green and purple.
Here’s an article which goes a bit more in-depth: https://www.washingtonpost.com/news/the-fix/wp/2016/11/08/red-vs-blue-a-brief-history-of-how-we-use-political-colors/?noredirect=on&utm_term=.01894ce53d78