I think both these cases are fundamentally different -- the baker can refuse to bake a certain type of cake, on the grounds of religious expression clashing with the cake he is making. However, it's different if he refuses service on the grounds of the type of people he is making the cake for.
and in the actual case the baker refused to write a message on the cake. he was fine with the clients and with the cake.
He only objected to a custom message defying his belief. There are good arguments on both sides. (my stance is sort of about scale as in if he had enough employees to delegate or he was the only cake-maker there)