This is already a known issue and waste water plans have treatments to address some of the impacts. I found an article from 2012 where they specifically talk about cost of addressing the contraceptive pill's impact on British water systems.
But how could such treatments work? The drugs are a wide range of organic chemicals mixed in with the literal crap of sludge, which is also a wide range of organic chemicals. Just how is this supposed to separate out or degrade the drug residues without also destroying the sludge?