In his summing up, Mr Mackay said Chambers' right to work was not a good enough reason to overturn the ban, while the last-minute timing had also worked against him.
"Many people both inside and outside sport would see this by-law as unlawful," said Mr Mackay.
"(But) In my judgment it would take a much better case than the claimant has presented to persuade me to overturn the status quo at this stage and compel his selection for the Games."
British selectors have to name their final squad for next month's Games in Beijing by Sunday at the very latest.
Chambers had already gained the necessary qualifying time for the 100m and comfortably won the British trials in a time of 10.00 seconds on Saturday.
Chambers leaves the High Court
But when the British team was named on Monday, only Simeon Williamson - who finished second behind Chambers in the trials - was named for the individual 100m event, with two places left unfilled until the legal case had been decided.
Craig Pickering and Tyrone Edgar have also secured times within the Olympic qualifying mark of 10.21, and UK Athletics (UKA) selectors will meet on Saturday to decide who to take to Beijing before seeking ratification from the BOA.
BOA chairman Lord Moynihan said the judge's decision had vindicated the by-law, which has been on the books for 16 years.
"The BOA will continue to send a powerful message that nobody found guilty of serious drug-cheating offences should have the honour of wearing GB vests at the Olympic Games," said Moyniham.
Chambers, pursued by scores of journalists, TV cameramen and photographers, left court saying almost nothing to the media.
Culture Secretary Andy Burnham, whose portfolio of responsibilities includes sports, believes the decision was a major boost for GB's Olympics team.
"I was pleased when I heard the news," Burnham told Radio Four's Any Questions? programme. "And we won't have a controversy overshadowing the British team as we get close to the Olympics."
We've lost our best sprinter, but our best sprinter's best time this year is only just scraping into top 10 in the world
BBC Radio 5 Live sports news correspondent Gordon Farquhar
BBC Radio 5 Live sports news correspondent Gordon Farquhar said Chambers' absence would not have a massive effect on the Britain's medal prospects.
"We've lost our best sprinter, but our best sprinter's best time this year is only just scraping into top 10 in the world, so his prospects of a medal were only very slim anyway," he said.
"Whether he'd have added to the relay is a matter of debate: UKA would say probably not, as he's not been training with them and if you use a team who train regularly you gain a few tenths of a second you wouldn't necessarily gain from having the fastest man in squad.
"It might also have a galvanising effect on the BOA. They were extremely nervous about not succeeding, it's a boost to the people who run the team and all the athletes who felt very strongly he should play no part, so it may have a positive effect on the rest of the team."
After his positive test in 2003, Chambers admitted he had taken other banned substances to enhance his performance and also revealed to the BBC that he had started taking THG 18 months before he was eventually caught.
BOA pledges to continue drug-cheat ban
The revelation led to him being stripped of the 100m gold medal he won at the European Championship in 2002 and also cost him and his team-mates the gold they had won in the 4x100m relay.
While serving a two-year ban from the sport, he attempted to forge a career in American Football and earlier this year tried his hand at rugby league with Super League side Castleford.
But he did win silver for Britain in the 60m at the World Indoor Championships in March.
John Regis, who used to coach Chambers, said the decision would hit the athlete extremely hard.
"He'll be gutted, there's no other way to put it," he told BBC Radio 5 Live.
Michele Verroken, the former head of anti-doping and ethics at UK Sport, said other countries should follow Britain's lead by taking a strong stance against former drug cheats at the Olympics.
"I would urge other nations around the world to consider the same eligibility by-law because it's a very important way of protecting the integrity of the Olympics, " she told the BBC.
The World Anti-Doping Agency (Wada) welcomed the High Court ruling.
"This decision sends a strong message that athletes who commit serious doping violations will have to face significant consequences," said Wada president John Fahey.
"The unanimous consensus found by Wada's stakeholders to strengthen sanctions for serious anti-doping rule violations under the revised World Anti-Doping Code to come into force in January 2009 is a further sign that there is, and that there will continue to be, no tolerance for cheats in sport."
International Olympic Committee member Sir Craig Reedie added: "I think the IOC is moving in the general direction of the BOA's philosophy.
"The new rule that will come in post-Beijing will involve an eligibility penalty on any athlete testing positive.
"He or she will not go to the next games if there are sanctioned for six or more months."
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.