Another perspective: your current approach to living a life aligned with your goals (goals, that, by the way, I entirely agree with and commend) is to think about your personal behaviour, almost as a sort of "purity". I think you're doing this thoughtfully and in an evidence based manner (for example, focussing of meat consumption and air travel, instead of almost entirely cosmetic actions like bamboo toothbrushes and electric cars), which makes me think that you're doing your research about this.
However, individual actions are ultimately limited in scope: if you went completely off-grid and ate only discarded fruit and wore sackcloth, you might save 10-40 tonne of CO2 a year. That is, objectively, a complete irrelevance. Small changes that propagate beyond yourself are likely to have a much higher cumulative impact than your entire personal carbon footprint.
The other aspect is that if you abandon this academic career, you won't leave an empty footprint: your place will be taken by someone else. So the challenge is: can you, in the academic career you enjoy, make the world better (according to your aims) than if you were replaced by a person who doesn't care about these aims? The answer really depends on whether you put your principles into action. Here I can only speak in general terms, because microelectronics is not remotely my field:
- Can you identify academic groups or companies that do environmentally sound work and align with your expertise? This could mean (I'm guessing here)
- Reduce the use of rare metals or other unsustainably sourced materials
- Improve the lifespan of devices and components to reduce waste
- Build equipment directly involved in the production of e.g. sustainable energy
Get in contact with them, get ideas about possible joint projects or discuss postdoc/job options. A PhD isn't forever; the next step of your career is much more important to define your trajectory. To give you my personal example, I left my postdoc in a very prestigious neuroscience lab for a data analyst job in a national public healthcare body. My scientific career has not been wasted; in a way, I have "donated" my science expertise to a purpose that is much more aligned with my priorities. Can you find a similar path? It can be outside academia, like in my case, but also within.
- Can you leverage your position within your institute to bring about positive change? For example
- Many Universities have active divestment campaigns, some of which have resulted in genuine changes in investment priorities; look for one and get involved
- There are movements in many disciplines to reduce emissions associated with conference air travel, such as organising virtual and "semi-distributed" conferences (local in-person hubs with remote connections to each others) and supporting alternative modes of travel; now is an incredibly good time to get into this (bonus, this is also great for inclusion given that not all institutes have the budget for intercontinental conference travel)
- Find other members of your institute who share your concerns and organise with them to identify and create pressure to change some of the most wasteful practices (some may be inevitable, but I'm sure there are things that are done out of habit and convenience that could be addressed)
Others have brought up much more specific examples; my main suggestion here is to link with others and not focus on individual action. Climate collapse is a concern that is shared by the majority of PhD-age people. You don't need to reinvent the wheel, and you can be part of a much bigger wheel than you could ever hope to build yourself.
As per the defense stuff, I'm with Captain Emacs on this - if you disagree with it, then the only route is disengagement. If these are specific, circumscribed topics or projects, I think you are absolutely within your rights to refuse to work on them. It's up to you how outspoken you want to be about this, but if you think you can handle it, I would encourage you not to hide your motivation. Others may share your reservations but fear to go against the groupthink that everything is fun and exciting and consequences are for others to worry about. As another personal example, my institute at one point discussed the possibility of expanding into primate research. I was strongly opposed to this and, once I made my position known, quite a few people who'd said nothing before actually spoke up against the proposal. I have no way of knowing if our opposition made any difference to the decision, but the proposal was nixed.
Feeling conflicted is a good, good thing: it means you have ethical principles, you stick to them, and you recognise when you're not abiding by them. However, just experiencing this tension does not "absolve" you and, crucially, won't make you feel better about yourself. The way to address it is action. You have identified one action - disengagement. This solves the problem for you but actually makes little difference to the things you care about. Look for other actions that bring what you believe and what you do closer together. It may be that you come to the conclusion that you can't bridge that gap (a friend of mine who worked in consultancy came to that conclusion and left the industry); but look for other options beyond staying and accepting practices you know are wrong, and leaving altogether.