We're all mistreated and we mistreat each other.
First - there's the serious mistreatment. I.T. is treated like a pariah at many companies. We are an expense, and we are an expense that many companies have a difficult time grasping. "We send the plumber away after he fixes the toilet, why do we have this guy on the payroll after he fixed my printing issue?" Bean counters especially hate us, because the things we support and provide to the users are expensive. I don't care who the computer is for, I.T. is blamed for it being purchased for it needing support. This is very much a "shoot the messenger" problem. I've seen companies that get rid of their support people, and I've seen it hurt them in the end. I've seen executive assistants - the guard dog types - really hate on I.T. because their master had a computer problem that wasn't immediately fixed and you're expensive.
Second - there's the peer to peer mistreatment. We're I.T., we eat our own. We are continuously cruel towards one another, especially if we like you. Holding back and treating you like a customer means we really don't want you around or we consider you a volatile liability. It's something I've found as pretty much a universal culture among competent technical people. We like practical jokes, well placed insults, and picking at each others issues. We're like a bunch of junior high kids, never mind we're in our 30's and 40's. Most of the people I've seen have a problem with mistreatment seem to only have the problem after they become accepted as part of the group. Some people just don't know how to fit into the culture. This isn't a race or gender thing, I've seen acceptance and breakdowns in about every combination of race and gender you can imagine. We're geeks, competence is currency, if someone is placed in an I.T. area due to affirmative action or nepotism they aren't going to become part of the pack. If you can't pull your own weight they're not going to feel sorry for you, they're going to eat you for lunch. Most successful technical environments I've been in have been meritocracies with the exceptions of rule by the person signing the checks, in which case even those setups are virtual meritocracies where you have the alpha-geek and the guy who can over rule the alpha geek.
Third - the serious real discrimination. Most real discrimination I've seen comes from H.R. departments and busy-bodies. Forced diversity is discrimination. I've been in really good self-governing technical departments. Usually the more offensive and wolf-packish they are, the better they are. I have on occasion had the pack destroyed due to concern from busy-bodies who don't understand that mode of operation intentionally changing seating arrangements, injecting people who aren't exactly up to par, and intentionally injecting people with polar opposite personalities into the team (who don't even technically qualify for the job) just to break up the wolf pack. I saw the intentional pack breakup happen by an injection that increased the size of the team 25%. Productivity fell by 40% as the old wolf-pack had to drag anchors through the work day. FYI, in the situation I'm talking about - the rudest, crudest, and the leader of the pack was female, she was awesome, she told the dirtiest jokes I've ever heard and had a photographic memory, able to recall data at will that I had to look up. We had both Hispanics and Blacks on the team that were part of the pack. The intentional breakup had nothing to do with race or gender - they wanted to break up what they saw as a homogenized personality type. The injected individuals consisted of a white female, a white male who was tech savy in an engineering sense but was mild mannered and couldn't handle high pressure rapid fixes of in a monitored queue environment. He was the type who would spend a day or two getting at a problem the rest of us knew how to plow through. The third was a black female that could barely operate Outlook. In the end their attempt at diversification actually percentage wise increased the white percentage, it increased the female percentage as well, but it destroyed productivity.
I think the culture of tech fields can generate these feelings even when the cause is a bit different.