Most of the time the engineers making these things -think- they are reasonably secure, but they tend to have little to no infosec experience and are moving too fast with no accountability.
Worse, even when there is some accountability such as code review, the release engineer creates the security problems at release time either as a supply chain attack or stupidity.
If I were making the rules, I would ramp up common sense supply chain accountability which would cause some of the most prevalent problems to be spotted early.
My wish list:
1. Require all source code be signed (git signatures or similar)
2. Require all source code reviews by peers be signed (minimum 1)
3. Require source code to compile deterministically
4. Require at least two individuals or entities verify code signatures, compile code, and compare identical hashes
5. Require proprietary firmware products have an external security firm on retainer incrementally reviewing code (including dependencies!), as well as reproducing, and co-signing releases.
6. Require proprietary products use a source code escrow service that will make their code public the day support and security updates stop so the consumer community can patch for themselves
7. Require open source firmware products have a bug bounty program (potentially with government funding like the EU does)
Happy to chat about this sort of thing with anyone interested. Contact info in my bio.