No, unfortunately it is not illegal. Employment in this nation is "employment at will." Among other things, that means that no one has a right to be hired or to a job, and that an employer may refuse to hire you for any reason that is not specifically illegal discrimination, such as not hiring you due to your race, color, national origin, sex, disability, religion, or age 40 or over. That is, they cannot refuse to hire because you are, say, 40 years old or a minority, but they *can* refuse to hire an older worker, a minority, a woman, etc. for any reason other than their protected status. Unfortunately for you, a criminal record--including pending but unresolved charges, or even an arrest that never led to a conviction--is not protected; the law is clear that employers may refuse to hire you for any criminal background at all. Therefore, that you have have pending charges is a legally valid reason to not hire you.