Hello. Let me try to explain this question for my study as well.
a. 金魚は たん水"が"好きですが、かい水"が"あまり好きじゃないです。
First of all, it may confuse you more, but this is not natural expression. We use these 3 patterns [b] - [d] below instead of the above [a].
b. 金魚は たん水"が" 好きですが、かい水"は" あまり好きじゃないです。
c. 金魚は たん水"は" 好きですが、かい水"は" あまり好きじゃないです。
d. 金魚は たん水"は" 好きですが、かい水"が" あまり好きじゃないです。
You can see "が" isn't repeated in these 3 sentences.
To understand this, in many cases, "が" is used when you already recognize "the part after が" as the topic and want to emphasize "the part before が" as new fact. And "は" is used when vice versa, or when you describe the whole parts as new fact, etc. "は" is more generic. And "が" or "は" is also used in the case to repeat the phrase that someone said before.
The reason why [a] is strange I think is that between the former clause and the latter clause, the topic has a little changed from 金魚は...が好き to 金魚は...あまり好きじゃない, and "が" is still used without any indication about it.
And the difference between [c] and [d] is like this. In [c] the emphasis is on "あまり好きじゃない" and in [d] on "かい水" and indicates it more exclusively. You can use this [d] like when giving advice to others to emphasize the importance of avoiding かい水.
It might exist better explanation. But I just can explain like this way for now.
Adding to the explanation above, I thought out examples of questions to get each of the answer [b] - [d] for your reference.
For [b]: 金魚は たん水"が" 好きですか? かい水"は"どうですか?
For [c]: 金魚は たん水"は" 好きですか? かい水"は"どうですか?
For [d]: 金魚は たん水"は" 好きですか? (また、)あまり好きでないもの"は"ありますか?
Hope this helps.