In this case, five supreme court justices - Lady Hale, Lord Kerr, Lord Mance, Lady Black, and Lord Hodge - found that the bakery did not discriminate against Mr Lee and didn't refuse his order based upon his sexual orientation.
Daniel and Amy McArthur, who run Ashers Baking Company in Belfast, believe that the only form of marriage consistent with biblical teaching and acceptable to God is that between a man and a woman.
"The bakery would have refused to supply this particular cake to anyone, whatever their personal characteristics", court president Lady Hale said in delivering the majority opinion.
"But that is not what happened in this case".
Britain's Supreme Court has ruled in favor of a bakery that refused to make a cake celebrating same-sex marriage for a gay customer.
Speaking outside the Supreme Court after the judgment was handed down, Gareth Lee said: "To me, this was never about a campaign or a statement". The owners did not support gay marriage for religious reasons and therefore declined to make the cake.
In its judgement, the court also referenced the US Supreme Court decision in the Masterpiece Bakery case, which cleared the baker of refusing to serve a gay couple.
Although I profoundly disagree with Ashers opposition to marriage equality, in a free society neither they nor anyone else should be forced to facilitate a political idea that they oppose.
"The objection was not to Mr Lee because he, or anyone with whom he associated, held a political opinion supporting gay marriage", she said.
Owners Daniel and Amy McArthur, who have said the law risked "extinguishing" their consciences, will be in London for the court's judgment.
"We always knew we hadn't done anything wrong in turning down this order", he told reporters outside the court.
Lee, a gay rights activist, sued the company for discrimination on the grounds of sexual orientation and political beliefs. "I'm concerned that this has implications for myself and for every single person". The BBC reported that the Equality Commission had spent £250,000 (NZ$460,000) of public money on the case and the bakery more than £200,000 (NZ$370,000), paid by charity and lobby group The Christian Institute.
Mr Lee and Dr Michael Wardlow, the chief commissioner of the Equality Commission for Northern Ireland, are expected to be at the Supreme Court for the ruling.
Northern Ireland is the only part of the country where same-sex marriage is not allowed.
It is deeply humiliating, said the president of the UK Supreme Court, to deny someone a service due to their sexual orientation.
He said: "We're delighted and relieved at today's ruling". It received backing from the Rainbow Project, Northern Ireland's largest support organisation for lesbian, gay, bisexual and transgender people.
Overturning a lower court's ruling of discrimination, the high court determined in a 5-0 ruling that Ashers Backing Co. rejected the message, which it has a right to do, not the messenger.