Taxing activities that have negative externalities is a positive use of taxation.
It's better than forbidding such behavior for many reasons. The simplest reason is that it's better to make revenue dis-incentivizing something bad (pollution) as opposed to dis-incentivizing something good (income).