Only reason I can see why the baker should be forced to make the cake is if he agreed to it and accepted a down payment before he knew the couple was gay. There might be a case of a broken contract there.
If, also, there was not reasonable time to find another provider before the wedding, that might add to the case...but if there was time to go before a judge, it would seem there was time to find an alternate provider.
As a compromise, I might suggest that the couple find another baker and the original baker make up any difference in price. If that is not acceptable to the original baker...and I would doubt it would be, then HE can find the alternate baker of the same quality and keep or make up the difference....of course this is IF the baker accepted the job before hand.
If the baker declined to fill the order from the get go, there should not even be a consideration of him being required to make that cake.