The legislation is seen as an important step in reversing Spain's reputation as soft on doping and the government hopes it will improve Madrid's chances of winning the right to host the 2020 Olympic Games.
"We are going to need some time to become credible," Ana Munoz, director general of Spain's anti-doping agency (AEA), told local radio.
"The image of Spanish sport abroad is magnificent but in the fight against doping our image is not good," she added.
"Having this law in parliament is the guarantee that Spain is in the vanguard of nations who want to tackle doping and protect the health of athletes."
The bill seeks to bring the country into line with the World Anti-Doping Code, which went into force at the beginning of 2009 and provides a framework for anti-doping policies, rules and regulations for sports organisations and public authorities.
An attempt to update Spanish legislation under the previous government foundered but the current centre-right administration hopes this time the bill will clear parliament.
Athletes caught cheating will face fines of up to 400,000 euros ($523,300), although the use of banned substances and other doping methods will not be considered a criminal offence.
The bill also gives authorities the right to conduct doping tests between 11 p.m. and 6 a.m. in exceptional cases as long as the reasons are explained to the athlete.
The presentation of the new law coincides with the "Operation Puerto" trial in Madrid of Spanish doctor Eufemiano Fuentes and four other defendants accused of running a doping ring in professional cycling.
The World Anti-Doping Agency (WADA) is optimistic the trial, which started at the end of January and is due to conclude at the end of March, will finally lead to evidence of possible wrongdoing in other sports being made available.
Fuentes has revealed that as well as cycling he had clients in other sports including soccer, tennis, athletics and boxing.
WADA's requests for access to evidence seized by police in raids in 2006 have been repeatedly denied by the Spanish courts, although the judge in the "Puerto" trial has said she will consider a fresh WADA request.
($1 = 0.7644 euros) (Reporting by Iain Rogers, Editing by Clare Fallon)