The World Anti-Doping Agency on Saturday declared Spain and Mexico to be non-compliant with its regulations after they failed to meet a Friday deadline to make required changes.
However, Olympic host nation Brazil avoided sanctions.
A non-compliance ruling could suspend work at the Spanish and Mexican national anti-doping organizations and lead to two drug testing labs in Spain and one in Mexico being decertified.
However, WADA praised Mexico's government for taking steps to resolve the issue, and said it was "hopeful that the necessary work will be completed in the very near future."
Spain's anti-doping rules are enshrined in law, but political stalemate has stopped the country from making the required changes.
Spain has not formed a government following elections last year, and the parliament has not updated the country's anti-doping legislation to match the revised WADA code from 2015.
"WADA recognizes that there is no sitting government in the country, and therefore understands the difficulties the country is facing with resolving its outstanding issues at this time," WADA said.
Spain's anti-doping agency said in a statement on Saturday that it "wanted to thank WADA for its understanding regarding Spain's current political situation."
Brazil, which hosts the Olympics in Rio de Janeiro in August, was not punished after it passed new legislation on Thursday.
Brazilian President Dilma Rousseff signed an executive decree to bring the country into conformity with international doping rules, a move that was confirmed in the government's official gazette.
The new rules will create a single national tribunal for doping cases across all sports, and should speed up hearings.
Spain, Mexico and Brazil were among a group of six countries put on a watch list by WADA in November. The other three countries from that list - Belgium, Greece and France - "resolved their code-related issues" by the Mar. 18 deadline, WADA said.
Besides Spain and Mexico, WADA earlier ruled Russia, Bolivia and Andorra to be non-compliant. In Russia's case, that followed a WADA commission report detailing state-sponsored drug use and alleged cover-ups by the country's anti-doping agency and drug testing lab.