Both are asking for money to extract oil (and hopefully sell it for more money). I don't see why the oil well being already drilled or not should make a difference if I don't want to invest in CO2-producing endeavours.

The point is that in the secondary market, the oil will be extracted regardless. By you not participating, you actually increase the return on equity for others, making it more profitable. Buying the stock does not add money into the business.

The area for disincentivizing oil production is the political sphere, not the financial sphere. Refusing to participate in secondary market ownership does almost less than nothing to disincentivize the extraction. At least with ownership, you get a say in the firms harm mitigation.

To be clear, I was answering your second paragraph, about "funding oil extraction that is happening anyway". I understood this as "buying shares directly from the extracting company".

I agree that buying on the secondary market doesn't directly give money to the company. However, it increases demand (and therefore price) of shares in petrol companies, which might help them raise more money per share for new projects.

The earnings coming from such shares also comes from actively encouraging CO2 producing activities. Some people don't want to earn money that way, because they think it is morally wrong.

>Some people don't want to earn money that way, because they think it is morally wrong.

I mean that's fair, but it's also why I brought up the three major schools of ethics. The consequentialist likely won't care if it's going to happen anyway. The virtue ethicist will.