Most insecticides need time to work. If you vacuum too soon after spraying, you could remove many of the bugs before they have a chance to ingest the poison and die. That said, if you're using a contact insecticide (one that kill bugs on contact), it's okay to vacuum right away because the pests will be dead when you come in contact with them.