So if the FDA was supposed to stop this, why doesn't it?
The FDA’s stated goals in 1906 (it wasn't known as the FDA until 1930) were roughly the same as they are now: "[the organization] protects public health by assuring the safety, effectiveness, and security of a wide range of products, including prescription drugs."
Despite its lofty ambitions, the FDA was relatively toothless until 1962, when Congress endowed the FDA with some real power to ensure that drug companies didn't make false claims (otherwise known as lies) about their products' effectiveness, and to enforce penalties for any misleading statements or claims. Drug companies were finally held responsible for demonstrating "substantial evidence" for the effectiveness of their products.
Fast-forward to the 1980s: while Ronald Reagan was telling Americans to "Just Say No," the feds cozied up to the pharmaceutical industry, and relaxed their legal restrictions. Direct-to-consumer marketing (DTCM), what you probably know as "drug commercials," was first given the seal of approval in the US in 1985.
Even though pharmaceutical companies were legally allowed to advertise new drugs directly to consumers, the law still required a full list of side effects; this mandate meant DTCM ads were mostly restricted to print, then the only medium that could provide enough space to tell people they might get night sweats and night terrors and night cravings and night terror cravings.
Drug commercials as you know them really only began in 1997, when constraints were further loosened, and new meds began to feature in television commercials. For its part, the FDA notes that no federal law has ever outlawed drug ads, justifying its progressively lax regulation.