The facts of the 2 cases are very different.  In the latter case, the customer wanted the bakery to write something on top of the cake.  In the present case, the baker was not asked to write anything.  No one in this country can be forced to write something with which he disagrees.  But just being asked to do the job he went into business to do is covered by anti-discrimination laws.