Doping in sport should absolutely never be legalised. Drugs or illegal medications are never good for the human body, and its consumption can create addiction, lowering the life quality of the person who takes them.
I think it's actually possible to stop athletes breaking the rules; it's just that, sometimes, they never have anyone to help them when difficult times are coming, and they use drugs as a source for solution, when in fact that's a problem.
Athletes are both cheats and victims. Cheats because they use drugs although they know (or sometimes even don't) the side effects that drug consumption might have; and victims because they're influenced by society, and whenever bad times come, they feel the peer pressure and get into drugs.