Yes it makes money from them. But if they weren't available the legacy manufacturers would pay far more in fines for not meeting emissions quota
So it's effectively a subsidy to Tesla as the main electric car maker in America.
Quite ironic really when Musk clearly supports Trump and his voiced intentions to expand fossil fuel extraction. Indeed, Trump has signed an order fast tracking fossil fuel permit infrastructure.
Still, that particular cash cow may not quite as productive for Tesla in the future, at least so far as the US government is concerned, thanks to Trump.
Meanwhile the batshittery in Trump world continues with Trump signing an Executive order to create a sovereign wealth fund. Perhaps to be funded by all of the tariffs Canada, Mexico, China etc., will allegedly be paying?