There exist investment firms where some measure of return to society is incorporated into investment decisions (see e.g. https://acumen.org/). If your business is creating some sort of positive externality, then seeking these sorts of investors (whose problem interests are aligned with your company's) may be a good fit.
It sounds like what you actually want to do, however, is just create a vanilla business and put a cap on what is returned to investors. You can do this -- in fact, you can do whatever you want, the world is your oyster. The only question is if anyone will invest. VCs who want an unbounded or very large upside won't, but there exist investors who will probably waive the right to any unlikely windfalls for more certainty of low-level gains. See e.g. https://earnestcapital.com/about/.
I got in the field motivated by a specific problem that I wanted to build a solution for. I needed to learn programming to do that. Keeping the problem in mind has led me to study and increase my capabilities in a variety of areas, and currently I do ML research. I'd highly recommend this approach if you have a problem that is particularly motivating or interesting to you, as it can consistently point you useful directions to explore independently of any one job or piece of technology.
For the first job, mine was at a startup. Founders may be more willing to take a bet on someone who demonstrates passion and an ability to hack on stuff and get it to work, whereas big company hiring seems to be more conservative.
Performing superbly on technical interviews will always get you hired, regardless of your background. If you have a buddy also interviewing, pair up and give each other as many whiteboard interviews as you can (I did 2-3 weeks of 5-6 problems per day). You'll feel much more confident.
Lastly, work on projects you are actually excited about, and interview at places doing stuff you're excited about. That sort of excitement really shines through in an interview. Additionally, it will pay off in quality of life.
Me: Teach me about the politics of the future in America
.
Hannah Arendt: U.S. politics are going to change dramatically over the next 5 years. You're looking at a period of increasingly authoritarian policies.
Me: What happens after that?
Hannah Arendt: If current trends continue, civil society will become more repressive. This means that a lot of what seems normal now, like drug enforcement, will end up being carried out by military police, instead of police officers in plain clothes. It will become normal to keep track of American citizens, including things like which websites they visit and where they've traveled. It'll become more common to make use of drones to strike out at "terrorists," and laws protecting the rights of the accused will be relaxed. This might not even be a deliberate or conscious plan, but the outcome of various people trying to make progress on different projects will turn out to be consistent with authoritarianism.
Me: Is there an upshot?
Hannah Arendt: Actually, there's one positive thing I can mention. The American middle class will likely collapse in the next 5 years. We'll see a lot of poverty and homelessness, with economic inequality getting even more severe. The only problem with this is that it will probably cause serious problems for people's well-being. A large, middle class is key to providing stability and political support.
Me: That doesn't sound good. What's positive about that?
Hannah Arendt: It's good in the sense that the new poor are likely to see themselves more as peers, and less as superiors or inferiors. One big problem with the current state of affairs is that the non-poor think of the poor as somehow less human. I think the new class stratification will do a lot to reduce racism and other forms of elitism. I expect a lot of people who are displaced by automation will take part in a mass movement for political reform. And I think there will be a lot of technological advancement. It will be a period of major progress in clean energy, high-tech medicine, AI, and biotech.
It sounds like what you actually want to do, however, is just create a vanilla business and put a cap on what is returned to investors. You can do this -- in fact, you can do whatever you want, the world is your oyster. The only question is if anyone will invest. VCs who want an unbounded or very large upside won't, but there exist investors who will probably waive the right to any unlikely windfalls for more certainty of low-level gains. See e.g. https://earnestcapital.com/about/.