We have something like what you propose in germany [1]. Basically it causes the producers of packaging to end up paying for the disposal of the corresponding trash. This creates an incentitive for producers to make the packaging less wasteful.
[1] https://en.wikipedia.org/wiki/Green_Dot_(symbol)#German_dual...