How is it not allowed? Employers can’t choose who they want to hire? You’d obviously word it differently: unfortunately you’re not as good as another candidate. Better luck next time!
Equifax Employment Verification et al.
Which begs the question of whether those are illegal too...