In fact William was fighting for the English crown against his rival James II as part of a far wider European campaign in which the Pope was opposed to Louis XIV and his allies and supported a coalition which included William of Orange. The papacy was thus on the side of the Protestant William, not the Catholic James.