The subjuctive is used with verbs and expressions denoting an emotional reponse or value judgement:
Me alegro de que hayas tenido éxito
I'm glad you were successful
In the above example, there is nothing uncertain about the success - it has happened. But the 'alegro' requires a subjunctive.
Presumably, 'gustar' also expresses an emotional response.