It's not ideal to use ant and roach spray during pregnancy. The low exposure of occasional use is unlikely to pose a risk, but when it comes to most pesticides and chemicals, we don't have much data on how they affect human pregnancies.
Some studies have tried to determine whether pesticide exposure during pregnancy could be linked to child development problems or a higher risk of cancer, but the findings were inconsistent. Since there's currently not enough information available, it's best to play it safe and minimize use.
Also, because sprays usually control an insect problem only temporarily (rather than getting rid of the pests completely), they may not be your best bet for pest control anyway.
Instead of using sprays, you could try baits or other options that are not likely to be inhaled. You can also take steps to eliminate the pests' sources of food and water as well as access to your home.
For more detailed information about pest control and pesticide toxicity, contact the National Pesticide Information Center.
Mara Gaudette, M.S., CGC, contributed to this answer. She's a teratogen information specialist with MotherToBaby, a service of the nonprofit Organization of Teratology Information Specialists (OTIS).
Horton MK, et al. 2011. Impact of prenatal exposure to piperonyl butoxide and permethrin on 36-month neurodevelopment. Pediatrics. 127(3):e699-706. http://www.ncbi.nlm.nih.gov/pubmed/21300677 [Accessed June 2016]
Llop S, et al. 2013. Prenatal and postnatal insecticide use and infant neuropsychological development in a multicenter birth cohort study. Environment International. 59:175-82. http://www.ncbi.nlm.nih.gov/pubmed/23831543 [Accessed June 2016]
Vinson F, et al. 2011. Exposure to pesticides and risk of childhood cancer: a meta-analysis of recent epidemiological studies. Environment International. 68(9):694-702. http://www.ncbi.nlm.nih.gov/pubmed/21606468 [Accessed June 2016]