In both cases there are big issues around freedom of speech, the place of religion, the nature of offence, and the kind of society we are becoming. Peter Tatchell, perhaps suprisingly, backs the bakery in the 'gay cake' row, because of the free speech issues it raises:
This verdict is a defeat for freedom of expression. As well as meaning that Ashers can be legally forced to aid the promotion of same-sex marriage against their wishes, it also implies that gay bakers could be forced by law to decorate cakes with homophobic slogans.
It seems the judges have decided that businesses cannot lawfully refuse a customer’s request to propagate a message, even if it is sexist, xenophobic or anti-gay and even if the business owners have a conscientious objection to it.
Although I strongly disagree with Ashers’ opposition to marriage equality, in a free society neither they nor anyone else should be compelled to facilitate a political idea they oppose.