It's perfectly legal to say that your main clientele is young/ old/ male/ female/ gay/ straight and that therefore if you're not you might like to think again. What's not legal is refusing booking on that basis.
The other solution is a private members' club. Here is a Devon-based holiday resort for gay and bisexual men, no women allowed. This is legal (we can argue the toss about whether it should be legal, but it absolutely is). It presumably stays in business because enough gay and bisexual men want to go there that (a) that it's discriminatory doesn't bother them and (b) they're willing to piss around with maintaining the fiction that they're joining a club rather than buying a holiday.
The B&B couple could have taken the same tack. "This is a Christian B&B which excludes (whoever) and you have to become a member to stay here". It would have survived legal challenge. But there's a lot of problems problems. Firstly, unlike the niche market of holiday resorts exclusive to gay and bisexual men, "B&B in Cornwall" is hardly a unique market. So how many people would actually book at somewhere which involved joining a club? Maybe a few headbangers from your local "Jesus's words in red ink, meet at the school hall" church, but it's hardly a business. Secondly, private members clubs have all sorts of restrictions which make actually making a profit out of it quite tricky. And thirdly, the owners wanted to lose a legal action, so that they could appear all martyred and shit, and feel they were doing God's work. Hence their doomed appeal court action.
Instead, they had a proposal earlier in the year to become a charity or not for profit, see here. Again, this was at the advice of the CLC (or the Christian Institute, who are essentially the same people). Continuing to take advice from people who have lost multiple court actions for you isn't terribly wise, is it? This would have been laughed out of court.