You can be denied a hazardous materials endorsement for:

You will be denied a HazMat endorsement, or lose an existing endorsement, if you are not a lawful permanent U.S. resident; you renounce your U.S. citizenship; you are wanted for, under indictment for, or convicted of certain felonies; you are judged as mentally unstable or are committed to a mental institution; or you are deemed to pose a security threat by the Transportation Security Administration (TSA).
DMV Writen Test