A judgment has to follow the law.
I will infer from that you do not understand what "the law" is.
Law is NOT mere legislation.
That is obvious since mere legislation can be struck down.
And to do that, there has to be a higher abstraction.
Precedent is often used to make it easier.
But it is more than just going higher up to the constitution.
It is going back to British Common Law, to understand accepted social norms.
And they are all based on the defense of inherent individual rights.
That is what Jefferson explained in the Declaration of Independence.
That the defense of inherent individual rights is supreme.
And judges are only necessary because the rights of multiple individuals can collide, conflict, etc., and a compromise between them had to be stuck with a well considered balance.
So if one could just "follow the law", there would really be no need for judges.
You can't just "follow the law" for many reasons.
One is that the law could be inherently defective, inappropriate for the particular circumstance, unnecessary in some instances and even harmful in others, etc.
If you do not get that, then consider an example, like the castle doctrine where you can shoot intruders.
Obviously it is understandable if a 70 year old frail woman shoots a large male weapon wielding intruder at 4 in the morning. But it would not be understandable for a large healthy male to shoot a teenager who simply was at the wrong address.
You can never just "follow the law".
So getting back to this case, there is no indication at all the web designer would even remotely be harmed in any way by doing a gay wedding web site.