As a user and reviewer on Main, concerned about the site quality, I can sympathize with this question...
One type of code-only that could be deleted IMO is what is sometimes posted (esp. by newbies) to an already answered (usually older) question that pretty much repeats something in another answer. It adds no value whatsoever.
Along similar lines, if two answers give the same solution, but one is code only ("Try this" is often an accompaniment so that it's not "code only") and the other has a good explanation, then the one with the explanation should remain.
One problem to consider, however, is that the code-only contribution may have been posted first and has been marked as the answer, already. The "correct" solution would probably be to edit the explanation into the marked answer. This is frowned upon (although can be done without having to go through review by 2K+ users) and is to a certain extent not fair to the person putting in the extra effort.
Before implementing this, however, it should be considered that flagging/deleting such contributions would be a change in policy. Currently, anything that attempts to answer should not be flagged. I've had flags for this kind of thing declined. That's no fun for us or for the moderators...
In any case, this would mean more work for moderators as they'd need to delve into the entire Q&A thread in more detail than some apparently care to do. (I've seen numerous comments from moderators that they tend to view only the comment, without the surrounding context.) There's also the question of having enough knowledge of that particular technology to be able to judge the value of code-only.
A more accurate judgement could probably be made by silver-/gold-badge holders. But then the UI would need to be supplemented for these people at least being able to flag specifically for this kind of thing.