It's Managements fault
The only person who decides what the workplace environment is, is the supervisor. A worker does not have the power to control the workplace unless a supervisor or manager has allowed it.
Hiring based on gender and race is going to create unfairness. Yet more racism and sexism is never the answer to racism and sexism. The answer is a respectful workplace and while that must come from upper management it is the immediate supervisor who will have the greatest impact on producing a respectful workplace for the individual worker.
A boss cannot make people respect each other but they sure as hell can make workers act like they respect each other, particularity in a Union environment where respect is clearly part of the contract all are working under. But even if each worker has their own contract a company, the boss, can demand workers to act and be respectful at all times, and take action if that does not happen.
Managing is a skill, it is far harder to do right than troubleshooting, coding or any technical task that has direct cause and effect but at the same time those skills can be learned.
IME fairness is tricky in large part because the exact same treatment for one worker is not always fair or considered fair treatment to or by another worker. Equal is not always fair, it often is a lazy bosses excuse for failing to provide a respectful workplace.
For an actual example, consider a worker who claims they need to leave work early to pick up children from school. Normally that isn't accommodated on a regular basis but the worker claims special status due to gender and upper management agrees for political reasons. The other workers are quick to notice that the worker is working fewer hours but getting the same pay. That's not respectful and appears unfair.
Upper Management "solves" the problem by saying anyone who has kids can leave early if management agrees. Of course all other workers are too valuable to let go early. Eventually a grievance results in the worker leaving early losing pay for the hours missed, now they too think the situation is unfair. BTW the same workplace also had different expectations based on race, creating yet more unfairness.
In the above case there was a respectful solution and that was to allow flexible work hours and not put workers into the position of having to "sell" or rationalize their reasons. Supervisors should avoid making certain judgement calls. Those can result in one worker having their vacation cancelled so another can take their kids to Disneyland. Not wanting to make public that the first worker was going to visit a dying relative made that feel very unfair to them, even more so when the relative did die. (an actual case, that very productive worker ended up leaving for another company)
The problem isn't just an IT problem, many many industries and workplaces have similar problems but all of them can be addressed by better management. The problems of disrespectful or unfair workplaces can be solved, work can be a very pleasant place to be, and more productive.
Part of the trouble is most of those people who want to be in management, want to be bosses, to be seen as better, over others. It is a job where most of those wanting the position should not have it and all those who do get it should spend years in training for it. That also helps with the unfairness that is felt when promotions are available.
The requirements for promotion should be made clear and promotion should come from within first. Who the next boss is going to be should be obvious and the reasons why and how they got into that position should be obvious. The many courses should be available to those who want them, and anyone showing conflict resolution and respect to all should be encouraged.
It isn't rocket science, in many ways it's harder.