The FDA was created to enforce standards of sanitation and prevent false advertising in medicine (e.g. snake oil). The whole, “banning toxic additives” came later after science started understanding physiological dependence and addictive substances (e.g. actual coke in Coca-Cola).
Really, the FDA is an evolution of a lot of preceding government bodies and there’s a lot of history involved that they don’t cover in school 🤷