If your idea of abstinence-only education is to only tell kids "don't have sex" and that's it, then that’s a poor plan. But if you follow up teaching abstinence with reasons why abstinence is good (like protecting yourself from heartbreak, disease, and unexpected pregnancy, making your future marriage more likely to succeed, reducing your chances of living in poverty, pleasing God, etc.) and strategies for refraining from sex (like not spending time alone with your boyfriend or girlfriend near a bed, seeking accountability, etc.), then abstinence education can be very effective.
For the most part, people who belittle teaching kids abstinence assume that it’s going to be the first case where you just tell them to say no. But that is (mostly) a strawman. Very few people believe we should leave sex-ed at just the instruction to avoid it until marriage. Most agree that children should be taught more and expect that reasons and strategies will be included in the discussion. So the criticism of abstinence-only education is flawed. It's really a good choice if it is done right.
If the alternative to abstinence-only education was merely teaching them about different forms of protection and contraception, but still holding up abstinence before marriage as the norm and the goal to strive for, then I wouldn't necessarily be against it.
However, the sex-ed given in most schools these days is known as "values-free" sex-ed, which means they don't place any value on morality at all, even though sexuality is inherently a moral topic. On top of that, they blatantly teach that having sex as a teen (or even a pre-teen) is completely normal and fine, and don't teach the dangers inherent in having sex outside marriage (which go far beyond STDs and pregnancy). There is no condom that will protect against a broken heart. There is no way to have sex without making an emotional connection, despite the common teaching to the contrary. There is no protective measure to prevent premarital sex from causing fallout in future relationships and marriages. So even if you're teaching kids to use a condom every time, you're not really keeping them safe.
What's more, the emphasis on how to have sex "safely" (which is a misnomer when applied to sex outside marriage) and on making it cool and normal teaches kids that if they aren't having sex, there must be something wrong with them. And thus they're getting pressure from the school system, in addition to their boyfriend or girlfriend and peers, to have sex before they are prepared for it. And even for those already inclined to have sex, telling them it's perfectly okay isn't doing them any favors. They ought to be learning to develop self-control - the kind of thing that will help them out in their future life and marriage - rather than being told to just give in to their urges.
So, no, just telling them not to have sex isn't sufficient. But "values-free" sex-ed is even worse. The kind of sex-ed that teaches children to be promiscuous, to see sex as something to be "safe" from, to see babies as a danger to avoid, and to consider unexpected pregnancies as a crisis to be fixed by killing their unborn children is not only immoral, but it's not best for our children by any measure.
An education that is lacking in a moral foundation is inherently flawed and incomplete. And anyway, how exactly can you teach about a subject like sex, that is inherently bound up with morality (in pretty much every religion, by the way), without discussing morals?
If you teach that sex should be saved for marriage, everyone realizes that such a position involves morality. But the thing is, if you teach that when to have sex is up to each individual child to decide when they feel ready for it and give no other conditions for engaging in sex, that's a moral stance too (an immoral position, to be precise). It's not neutral! That’s not values-free sex-ed. It’s sex-ed that teaches the wrong values.
So if we're going to say that public schools should take no stance on the morality of sex, it should be completely silent on the topic and give only the biological details of human reproduction in science class. Teaching kids how to put on a condom or how to perform oral sex or teaching that sex is fine whenever they feel ready for it is not keeping morals and values out of the classroom.
I should also point out that if we're going to make schools the realm of facts, as has been suggested, then it is only right to include all the facts. And the fact is that sex places children in danger of a number of things beyond STDs and pregnancy.
Children should, at the very least, be given all of the information if we're going to turn them loose with no moral guidance. They should be told about the effects of oxytocin that will emotionally bond them to their sex partners. They should be told about the heartache that comes from having sex with someone who leaves you. They should be told that having multiple sex partners makes their future relationships and marriages prone to breaking up. They should be told that they can become jaded and unable to love freely due to being hurt too many times by having sex without a marriage commitment. They should be told that having a baby before they get married greatly increases their chances of living in poverty and that contraception fails regularly. They should be told that using porn can interfere with their ability to make love to a real person. They should be told that having anonymous sex can lead to depression and suicidal thoughts.
But with all the current rage for giving kids all the facts about how to perform all kinds of sexual acts and how to take pills and wear devices to protect them from disease and pregnancy, no one is telling them about the risks involved to their emotions and relationships and mental health, much less to their eternal soul.
So what is really happening when we tell children to have sex whenever they feel like it without telling them all of the facts is that we aren't actually educating them at all. We're indoctrinating them. We're actively teaching them promiscuity with no regard for the damage we are doing. That’s what modern “values-free” sex-ed does. And it’s not okay. We can do better for our children.