When a ruler passes a law in a state where the majority are known to disagree with it or to be members of a religion that disagrees with it - and incidentally, in Spain, Orthodox Jews and Muslims also disagree with this law - he is trying to provoke an attack on the faith of the people, and the people have a duty to resist him.
For example, early Christian converts who worked for the Roman government often did have to leave their jobs, because they realized the existing demands (offering incense to the emperor, for example) were incompatible with their new beliefs.
However, in the case of Spain, you have a radicalized Socialist government that is suddenly trying to impose a change on the traditional basis of a society. Catholics should be allowed a conscience clause. If not, they are not only permitted to resist, but have the duty to do so. And this was what the Spanish bishops conference proclaimed today.
but do the majority of Spaniards disagree with gay marriage
now if there had been a referendum, I do not believe this was the case in Spain and the majority voted in favour of gay marriage, then what
doesn't majority rule? even if it is a "bad" law?