Many investors have concerns similar to yours. This is generally referred to as socially responsible investing.
Socially responsible investing can mean taking an investing approach that seeks to avoid harm by not investing in companies in fields such as oil, gas or tobacco. It can also involve a focus on company practices – for example, energy companies that focus on ensuring they follow the best environmental practices.
There are funds available that focus on socially responsible companies, however these may not be set up to track the market. Consider your options before investing, and speak to a registered financial advisor or investment firm to ensure they are aware you want to make this a part of your investment plan.