Because the programmers weren't told to test for that and the crushing corporate culture didn't give them enough leeway to have their sense of professional ethics kick in and demand another couple of weeks to test for security vulnerabilities. Or to insist that they be secure from the start.
Because the boss didn't want to spend a couple of extra weeks testing for security issues for... whatever reason. An extra bonus at the end of the year. Showing up Johnson from the next department. Bragging rights. Duty to the company. Laziness. Distrust of underling's advice.
Because the big boss demanded more profit and promoted Johnson over Bob because his numbers looked better as opposed to demanding a better product. Because quality and security are difficult values to display on a spreadsheet. Because corporations exist to make money.
Things like this are a systematic problem. It boils down to "because they're fools".
Programmers can avoid being the sacrificial goat by, upon noticing a deficiency, bring up the issue to their boss. He'll either do the right thing and make a plan to fix it, or tell you to ignore it. If he doesn't fix it, make it official, ask about it in e-mail. Use keywords pertanent to the issue, like "vulnerability", "injection", "security breach" in this case. Stuff that an email search would pick up.
This is passing the buck. It's now your bosses responsibility. If it's important, like people are going to die when this thing fails, go over his head and bring up the issue to his boss. You can get fired for merely passing the buck, and you can still get fired even if you do pass it on, but it's the right thing to do. Not quite as right as actually fixing the problem, but close.