Many of these problems can not legally be prevented, but then again some can. To keep House Sparrows and Starlings away from your Eastern Bluebirds you must monitor nesting sites at least once a week. If you do come upon a House Sparrow or Starling nest remove it immediatly, install a House Sparrow Trap, and kill the male sparrow/starling (optional). Then plug the hole for a week (to discurage the female). You can also relocate the trapped bird 5 or more miles away.
To keep raccoons, opossums, cats, and squirrels out you can install a predator baffle (Nixalite) below the box, and a Noel Predator Guard around the entrance hole. To stop snakes and mice apply grease to the post or pole that the box is mounted on. When killing insects (DO NOT USE PESTICIDES) just eliminate them by hand (use hand tools; example: paint scraper). If you have ants in a nest box just take a paintbrush and brush them out. After brushing them out apply some grease to the post or pole the box is mounted on. Don't disturb any of the other predators because it is against the law (unless you have a specialized license). If you have any specific problems that you would like advice on just e-mail me.