Companies didn't create these policies arbitrarily and unprovoked. They became necessary because of some people who took advantage of the legal system to get settlements. It's in the company's best interest to protect itself from frivolous lawsuits, so it's better to be safe than sorry.
Which isn't to say that there aren't people who actually are discriminated against, but in this example it's not a company "discarding" someone as much as it is covering its bases.