We build a model analyzing optimal environmental regulation in the presence of socially responsible investors. Investors care about greenness of their portfolios but cannot fully resolve the pollution externality. Regulations, such as pollution tax and subsidies to clean firms, reduce dirty firms’ size but also reshape firms’ shareholder compositions. Under the regulations, dirty firms’ shareholders become, on average, less averse to holding polluting shares, and hence, these firms are less willing to adopt green technology. We show that pollution can increase with regulation stringency. Optimal regulations do not always fully correct the externality and can deviate from the Pigouvian benchmark.