Why is the gym icon color on my Pokémon different than my current team?
Solution 1:
According to this Reddit thread, this is a bug that is causing the Pokémon you have placed in a gym to display the Valor gym color while the Pokémon is in the middle column.
There’s a current bug that means the middle row will always have red gym icons, to test this for yourself, reorganise the order of your Pokémon and you’ll see
Your Gligar is in the center row, which matches what the post said. I tested this out myself, and this does appear to be the case.
Dragonite on the right column
Dragonite in the center column