When a firm's production generates external costs, the marginal social cost (MSC) of producing the good is higher than the marginal private cost (MPC). In a perfectly inelastic demand scenario, the quantity demanded does not change with price. A profit-maximizing firm will produce where marginal private benefit equals marginal private cost, ignoring the external costs. This results in a quantity where MSC > MPC, leading to a deadweight loss because the social optimum is not achieved.