Well, little problem is that english is not my native language so sometimes I am not sure if something means this what I mean it means
If: "then A said that C wasn't the spy. The judge said that he knew that" means that judge knows that C is not spy, and it certainly looks this way, then C is, obviusly not spy.
Then, we also know that A is not liar, because he told truth that C is not spy. So, B still can be everything, but A can only be spy or truth teller.
So...if A said Yes, and B said Yes, only possibility in that case is that A is spy (because if truth teller he wouldn't say Yes) - and in that case B is truth teller
if A said Yes and B said No, A still has to be spy, and then B can be liar
if A said No, however, then there are two possibilities...since he told truth about C, he can be either truth teller or spy - so if A=No and B=No, then A can be spy and B truth teller and A can be truth teller and B spy.
If A=No and B=Yes, then A can be truth teller and B spy, and A can be spy and B truth teller.
(Edit: actually B is liar in that case but it remains same)
So, the way task is given I guess judge is smart man, so in this case he would not make any assumptions - simply, if A said "no" then judge cannot have clue who is spy.
Therefore it must be that A said yes, and he is spy.