Is diversity an ethical reason to back out of hiring someone who was promised the position?
I was told in writing and verbally by two separate managers that they can no longer justify hiring me internally because I do not improve the racial/sexual diversification of their team even though I'm the only candidate.
There was a previous written agreement (email) on the salary I would receive, but after an unforeseen hiring freeze, my race and sex are evidently compromising my advancement opportunities in the company.
The hiring manager's previous written promise was encouragement for me to volunteer my time, proving I am competent for their needs. Coincidentally they have backed out of the agreement now that I've successfully completed the demo project that they are very grateful for (essentially spec work).
I've never been told my ethnicity and sex are stopping me from advancing. Nor have I been tricked into doing volunteer work. How should I professionally correct this ethics dilemma while ideally not burning bridges?
Update: The details of the hiring freeze are rather complicated. The open position that was meant to go to me ended up being used for an entirely different, senior position after a high ranking lead quit the company. So, this was unforeseen and they can't justify opening another position unless I am a diverse candidate since headcount must otherwise be kept to a minimum. In other words, rather than back fill the attrition, they just re-purposed my requisition since justifying new requisitions is evidently nearly impossible due to headcount reduction initiatives unless there's a diversity candidate.