Why を and not が twice?
This is an interesting phenomenon. In a simpler sentence:
is ungrammatical. However, when it is embedded under a verb that can assign accusative case and there is no other noun phrase that needs to be assigned accusative case, then the object of
In the example above,
Similarly in English, the subject in a simple sentence needs to be in nominative case:
so having accusative case on the subject is ungrammatical:
However, when it is embedded under a verb that can assign accusative case and there is no other noun phrase that needs accusative case, then the embedded subject can receive the accusative case (remotely) from the verb in the main clause:
私は先生が猫を好きだと思います sounds all right to me, while 私は先生は猫が好きだと思います would sound more natural.
Actually the first sentence (in the OP) is more like answering to the question asking 'Who likes cats?' while the other one (which I showed here) is answering to 'What do you think your teacher likes?'
I wouldn't say 私は先生が猫が好きだと思います... Why not? It just sounds unnatural... Well I might say that but wouldn't write that at least.