Rather, wedding cakes are a single example of the more general idea "lwas have to prevent people from being forced to do things in general".
So, how does this apply to your comment here?
Doctors are an unusual case because doctors have a legal monopoly over prescribing drugs. If the available doctors refuse to prescribe a drug, nobody else can do it instead without violating the law. There usually aren't legal monopolies over cake-baking.
Over at Scott Adams' Blog you can find a very fine example of using the 'Rationality Engine' to solve the social problem of assisted dying.