I don't know much about drug laws, but I can't imagine that it's legal for a non-LEO to arbitrarily confiscate a controlled substance (i.e. narcotic pain medications) from an individual.
I also can't imagine that it's legal to dispose of a controlled substance by simply throwing it into a public trash receptacle where anyone could get hold of it.
Assuming for a moment that the OP's story is completely true (which I personally doubt), the TSO who performed these two actions may have committed some rather serious crimes.
Perhaps one of our resident legal eagles or LEOs can clarify the relevant laws for us.