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.
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.
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.
There is a huge difference between funding oil extraction that is happening anyway, and funding a company to start extracting oil.
However, this is the intersection of consequentialism, deontology, and virtue theory.