Some scientists suspected that our ear wax may contain a natural fungicide, bactericide, and insecticide, the better to protect against buggy invaders crawling inside the ear canal. Alas, this turns out not to be true.
The disgusting crud that you dig out of your ear contains a few different components. The inside of the ear contains dead skin cells and sweat, like most of the rest of the body. There's some hair in there as well. What makes ear wax distinct are the secretions from the ceruminous glands, branched structures that are thought to be specially-adapted sweat glands on the inside of the ear.
Cerumen, the stuff that comes out of these glands, has been said to kill off fungus and bacteria, and even have insecticidal properties. Personally, I'd like to believe so, because an insect crawling around my ear canal is a thought that would keep me up until the end of time.
An ear canal, it seems, is not an ideal place for an insect under any circumstances. In 2001, a group of scientists decided to simulate the ear environment for some insects. They took various species that most commonly find their way into people's ears — ticks and beetles, honeybees, and cockroaches — and stuck them in test tubes. The test tubes were covered in different reagents, most of which eventually killed the insects (except for ticks, who were resistant to everything).
However, when chemists took a look at earwax, they found nothing in it that would specifically kill anything. It doesn't even kill bacteria, although it is remarkably free of bacteria when it's first secreted. So while most insects die fairly quickly if they get inside the ear canal, it's probably because it acts as "flypaper" and eventually immobilizes them until they waste away and die slowly.