There's tons of human labor to validate the drugs, and it's extremely expensive - hence the patent guards the time and money involved, not the "idea."
Drug companies are also starting to use AI systems for retrosynthesis - the sequence of reactions to take you from common precursors to the desired compound. My understanding is that these systems have gotten very good, to the point where clicking "Run" is most of the effort.
Pharma companies use synthesis patents to further hamstring competitors by cutting off viable routes to potential competitor drugs in the same class, or keeping their products from being manufactured once patent expires.
If they're allowed to file synthesis patents based on simply running the AI retrosynthesis algorithm, it'll do really bad things to the industry.
ps. You may have problems when it happens because the court/judge may be AI as well at that time.
I don't really see how an invention created by an AI that you developed is any different from an invention that you developed. There's no-one else with any claim to it. Inventions are achieved with the assistance of all sorts of tools - simulations, topographical optimisation, CAD software - but this doesn't mean they're suddenly not created by the person running the tool.