The security bugs are not there because of incompetence or stupidity. They are there because security is really hard and it is even harder to get every software engineer to care about security.
If the best organizations in the industry make security mistakes, what makes you think the rest don’t either?
Reality is often unpleasant. It is better to acknowledge it than to pretend it does not exist.