On the premise that it affects the decisions necessary for him to complete his work, I think it's reasonable for him to decide whether or not he wants to work on it. I see nothing discriminatory here.
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.
No my interpretation of this doesn't allow that, nor should it. What it would allow is for a tattoo artist to refuse to ink a gay (or straight, or really anything else) message on someone's arm. Maybe if it's an elective surgery that could be considered to be purely artistic (rhinoplasty?) then the surgeon could refuse but that'd be fairly narrow.
It would be _more_ like a doctor not performing a transgender operation.
Also, the market's capacity to support surgeons is limited; not everyone who wants to can be a surgeon. And you get better at what you do with experience/practice and with employment in a place where you learn from other qualified folks. Laws that make life hard for surgeons who hate some of their patients have the effect of opening up positions for potential surgeons who wouldn't hate some of their patients.
There is a question of just how fair this is to the surgeon / whether it violates some fundamental rights (which is what SCOTUS was addressing here), but there is absolutely a benefit to society in legislating hateful surgeons out of their jobs.
Except that's not the relevant comparison.
Judge: Doctors Have “Religious Freedom” to Refuse to Treat Trans Patients, Women Who’ve Had Abortions http://www.slate.com/blogs/outward/2017/01/03/doctors_may_re...
When doctors refuse to see transgender patients, the consequences can be dire https://www.washingtonpost.com/national/health-science/when-...
Will Health and Human Services Allow Doctors Refuse to Treat LGBTQ Patients? (Rating: True) https://www.snopes.com/fact-check/hhs-allow-doctors-to-refus...
Doctors Refuse to Treat Trans Patients More Often Than You Think https://www.vice.com/en_us/article/j5vwgg/doctors-refuse-to-...
Will surgeons soon be able to refuse to operate on patients because they're gay? After all, it's a service in an open market.
edit: it has been legal and common practice for doctors to refuse service to gay and trans people for at least two years. see thread below