I don't think you've been in software for very long. Most software is terrible. Code and software quality are serious issues. Unmanaged complexity costs companies millions of dollars. This is a direct result of the low average competence of software engineers, which follows from their inability to get good projects on which they would improve.
If engineers had better working terms, there would be a much larger number of decent software engineers out there, and the productivity of the software industry would improve massively.
Any employee should leave a company if they believe that their executive team is consistently shown to be inept.
Bad idea. 95 percent of companies have executive teams that are either incompetent or malignant. If you have a bad immediate manager, leaving is a good idea. Leaving a company because it has worthless executives is not, because that's the norm. You'll just end up job hopping in the search for something incredibly rare. Better is to assume that most executives are harmful and minimize your career exposure to their incompetence and malice.