You're right. It is discrimination. But I don't know of any law that prohibits it.
Employment is generally "at will." This means that, with certain exceptions, an employer can fire or can refuse to hire an employee or prospective employee for any reason. The exceptions include unlawful discrimination or retaliation. Another exception is that an employer can't fire someone in violation of a written employment agreement, such as a collective bargaining agreement.
Please note that I'm a NY lawyer and cannot advise you as to the application of your state's laws. For that reason, you may wish to consult with a local attorney.
Good luck to you.
Michael S. Haber is a New York attorney. As such, his responses to posted inquiries, such as the one above, are limited to his understanding of law in the jurisdiction in which he practices and not to any other jurisdiction. In addition, no response to any posted inquiry should be deemed to constitute legal advice, nor to constitute the existence of an attorney/client or other contractual or fiduciary relationship, inasmuch as legal advice can only be provided in circumstances in which the attorney is able to ask questions of the person seeking legal advice and to thus gather appropriate information. If you wish to contact Mr. Haber, you may do so by calling him at 212 791-6240 or by e-mailing him at info@Haberlawoffices.com.
I do not know which state you were applying for a job in. However, there is no federal law that prohibits an employer from refusing to hire you due to your credit. Even so, under the Fair Credit Reporting Act, the employer must provide you with certain disclosures, including the credit report, within a specified time period if it does not hire you due to the credit report. I am a NC attorney and cannot provide you with any advice concerning South Carolina law. However, if you were applying for a job in North Carolina, there would be no state law that would prohibit the employer from considering your credit history.