Without making a statement either way in regards to the ruling, one of the most critical issues in this case is whether or not writing a message on the cake is expressive.
Which is to say, that freedom of speech (or to not make speech) is at the center of this case. There is quite a bit of debate on whether or not decorating the cake is expressive conduct.
I can't see any way in which a surgeon operating on a patient is expressive, and therefore freedom of speech wouldn't come into it. Which means--even if the baker had won on expressive grounds (he didn't)--that the surgeon would still have no grounds for refusing the operate.