It means sprinter Dwain Chambers, 34, and cyclist David Millar, 35, can try to qualify for Team GB.
"The by-law is a doping sanction and therefore not in compliance with the Wada Code," Cas said.
The BOA had been locked into a lengthy legal battle with Wada over what it said was its right to continue imposing lifetime Olympic bans on British athletes, even after they had served suspensions.
In November, Wada ruled this BOA by-law was not compliant with the Wada code, prompting the BOA to appeal against the decision at Cas.
But Cas has ruled the BOA must comply with Wada, paving the way for British athletes who were banned for life from Olympic competition to be eligible for selection after serving shorter bans.
BOA chairman Lord Moynihan told a news conference: "The BOA are clearly very disappointed in the outcome.
"We must now move the discussion forward. We will seek far-reaching reform, calling for tougher and more realistic sanctions; a minimum of four years including one Games."
Moynihan on 'sad day for sport'
The BOA argued that its requirement for athletes to have clean drugs records was part of its Olympic selection criteria and had nothing to do with extending violators' punishments - a view supported by a number of high-profile current British athletes and the International Olympic Committee (IOC).
Following the ruling, Chambers' lawyer Siza Agha said the BOA had been "crude and defiant" in its determination not to comply with Wada.
Agha said: "In my view, as hosts for the 2012 Olympics, this delicate and emotive issue required international diplomacy, foresight and responsibility.
"What we have received has been a crude and defiant display fuelled by misguided statements such as 'we have standards and the rest of the world doesn't'.
"It has, in my view, been an exposure of colonial arrogance that even the most extreme and blinkered should have realised could only serve to marginalise British opinion on the international stage."
BOA lifetime bans
Britons on the BOA's lifetime Olympic ban list include:
Dwain Chambers (sprinting)
David Millar (cycling)
Carl Myerscough (shot put)
Peter Meakin (canoeing)
Jade Mellor (boxing)
Callum Priestley (hurdling)
Dan Staite (cycling)
Jamie Stevenson (shot put)
Athletes will still have to reach the Olympic qualifying standard to be considered for selection.
A spokesperson for British Cycling said after the ruling: "Our team for the Games is being selected in June and, across all disciplines, we'll pick the team based on which riders are fit and available, and who we believe have the best chance to deliver medals. Ahead of that we won't be speculating on who may or may not be selected."
A statement from Wada president John Fahey said: "Wada acknowledges the decision of Cas, to dismiss the appeal of the BOA against the decision of the Wada Foundation Board last November to declare the BOA non-compliant with the Wada Code.
"Cas has ruled that the BOA bylaw imposing a lifetime ban from the Olympic Games is an extra sanction and is therefore non-compliant with the World Anti-Doping Code."
But Cas added it was only seeking "a consistent fight against doping" across the world, and the BOA and IOC were free to persuade other Olympic authorities that a lifetime ban should be part of the Wada code in future.
"At the moment the system in place does not permit what the BOA has done," it added.
The BOA rule had been introduced more than 20 years ago and has kept a number of British athletes out of past Olympics.
Chambers had campaigned for the law to be revoked.
He tested positive for the designer drug THG in 2003 and was given a two-year ban, while Millar was handed the same punishment a year later after admitting taking the blood-boosting agent EPO.
Modahl calls for tougher bans
Both have since worked closely with the anti-doping authorities to help them crack down on drug cheats.
The Cas ruling was widely expected since the IOC lost a similar case in November after their Osaka rule - banning drugs cheats from the next Olympics even if their suspension was completed - was challenged.
The case was brought by the US Olympic Committee on behalf of their 400m runner LaShawn Merritt.
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.