And there *IS* the problem. This "bug" was in the system undoubtedly from Day 1 of the iPhone's release (and by extension, iPad's release). That's from 2007, when phones were not ubiquitous and being given to kids. As such phones became ubiquitous, with users requiring all kinds of things, programming the phones most certainly moved out of the hands of a few coders who knew all into the hands of many specialists. Rather like the difference from the days when you'd go to see one doctor for all your problems (eyes, skin, heart, abdominal pain), and now go to specialists.
If that's the case, which programer, EXACTLY, was supposed to see this buried issue, that original programers hadn't viewed as a problem, and wasn't a problem, and rooted it out on the speculation that it would be a problem?

And why should they have been looking for this over other problems that were a bit more important? Like being able to lock the phone, text, download apps, securely use Apple Pay, etc.?
Exactly how far into the future should programers in the past have seen, and exactly how deep into code written in the past and working just fine in the present should programers explore for hidden bugs? And how prescient do they have to be about what people might do with a product? That's certainly the magic of Apple, that they often see uses for their products that others don't AND that others see uses they don't--which helps the company develop the product further. But that's the problem as well. People will do stupid, and very unforeseen things with such products. So long as the company takes care of them when they DO become a problem, then I don't see a reason for blaming the company for not being able to whack every mole before it pops its head up. People losing their phones and their information, THAT was a real issue (remember this:
http://www.cnet.com/videos/wwdc-2009-new-app-helps-users-find-iphone/). This little prank is nothing by compare.
So. Why is everyone raining dow curses on current programers for not rooting out this old bug that the original 2007 programmers hadn't the imagination or foresight to view as being an issue come 2016?

Hindsight is 20/20. You really can't say "they should have seen that mole and been ready to whack it" unless you saw that it was going to pop its head up back when, yourself. In which case, why didn't you warn them?