How do negative externalities of production cause market failure?
Equilibrium quantity is where D(MPB) = S(MPC).
Because of external costs MSC>MPB. If there are no external benefits, then MPB=MSB.
The efficient or socially optimum Q is where MSB=MSC. This Q is below the equilibrium Q, so the good is overproduced.
Therefore, too many scarce resources are allocated to the production of this good. This is inefficient and results in market failure and welfare loss.