1- I don't think it was a good idea to legalise doping, that would go against the fairplay. The winner on a contest should be the strongest, or the hardest, or the smartest, or simply the best one, but it's unfair if someone takes advantage by braking the rules. Doping gets an easy way, a shortcut to avoid the hard work, so it's cheating and of course it's an illegal help for someone against the other people who follow the rules.
2- I think it would be possible to stop the doping just with two different fields to work. First there're the medical tests to the athletes: Improving methods and technical aspects, following their training and testing not only during the contest if not on the training time too. And finally there's the tests on the environment of the athlete. Which kind of censured and medicin do the medical team give to the athlete?. I think the medical team should share responsability with the own athlete and a ban also should be shared between the athlete and his doctors.
3- First of all the athletes who take drugs are cheats because they allways would have the choice to say 'no'. Later they're also some victims of the preasure to win, their lack of information about the side effects. So as I said before, the bans and the punishements should be shared between the athletes and his team