If by waste you mean excrement then this is not a good idea in the slightest. First you have bacteria, viruses, and parasites that must be killed off. If it isn't properly treated, you end up with a situation similar to that of what we saw in the recent North Korean refugee who suffered from parasites. After that, as you mentioned, there are pharmaceuticals which are notoriously hard to filter out. Next on the list is heavy metals that can become concentrated in excrement. Even after addressing these concerns, if the process to treat the waste is too costly, then there goes the benefit.
I would compare some of the challenges this faces to those that are faced when turning salt water into fresh water through desalination (probably not a direct comparison).