You misunderstood. This Supreme Court verdict does not alter the Equality legislation - you still can't discriminate based on protected characteristics and if Ashers had refused to make the cake because the person requesting the service was gay, then quite rightly the law prevents this.
The issue is whether you can refuse to do business with someone because you disagree with their ethics or values - and the photography firm were able to refuse to do business with the Christian Institute on that basis. As much as a business could refuse to print leaflets that support changing to an immigration policy they disagreed with or they could refuse to print leaflets supporting the introduction of sharia law into English criminal law etc
But the distinction then needs to be between individual people, on the basis of protected characteristics, and ideas and organisations. The latter do not have protections in the manner that the former do. My concern is the blurring of the distinction, and indeed it is sometimes extremely difficult to determine whether someone is discriminating against the individual or against the idea. This was certainly the situation in this case as it was at the heart of the matter and there wasn't unanimity of view at the differing levels of the legal system.
In this case there were also complications around discrimination on the grounds of political beliefs which are more stringent (for obvious reasons) in Northern Ireland than in the rest of the UK.
So what about a similar, but hypothetical, situation where it wasn't a cake making a quasi-political statement, but a wedding cake. If a man came into a bakers and asked them to make a traditional wedding cake for his marriage to his husband and asked for the cake to be topped with two little male 'groom' figures - should a bakery be allowed to refuse to make it. This seems to be a clear cut case of discriminating against the person (who is clear being treated less favourable as they are gay rather than straight), but the bakery could claim that it was merely their objection to same sex marriage.