IQ testing is designed to test for intelligent behaviour, which is largely based on long-term neurological development. The connections in the brain, densities of neurons, and long-term potentiations don't change greatly on a short-term basis. Measures which fluctuate based on spot-performance factors are typically deemed unreliable for the purpose of IQ testing.
Cognitive deficits caused by exposure to drugs and other substances tend to impact functioning of the neurons, and are detrimental to measures of intelligence, but are more appropriately measured by more specific tests, which focus on factors such as reaction time, or motor accuracy. Consider the cognitive tests performed by police when driving under the influence of alcohol is expected, for instance. Such cognitive tests also help provide a clearer picture of how a substance affects the brain.