University faculty have to beg for funding from the government or rich people. In STEM, most are funded through the MIC or do work that helps support it.
You'll try to be some math nerd, let's say. You work on graph theory that nobody cares about. Then, five years after you publish something you thought was cool but few people read, a colleague sends a graduate student your way. They ask about a pathfinding problem related to graphs and you tell them about your work and suggest a few directions of investigation and papers to read. They come back a few times so that you can help them overcome their misunderstandings. Five years later they present their DARPA-funded dissertation thanking you for helping make drone bombing routes more efficient.
Most academics don't even care that their work supports these things. They tell themselves that career advancement and being a big nerd are what matters. And some are just plain nationalists and imperialists. If you want to be a STEM academic you've gotta carefully thread a needle of avoiding any military applications and building up collaborations with people that you want to benefit from your work overseas.
Also almost entirely at the beck and call of the same imperialists unfortunately, especially in hard sciences and engineering.
But yeah, there's definitely engineering jobs that don't require you to work for lockheed out there. But the most lucrative ones seem to be the worst morally. I hear civil engineering is mostly nice, or yeah elevator mechanics make good money (usually union)