Really? So they can fire a 30-year worker the day before he becomes vested in the company pension?
Can they fire a secretary who won't sleep with the boss?
How about a worker that votes Republican, contrary to what bossman tells him to do?
1. In the case of the worker who is fired the day before he/she would be vested in the company pension plan . . . This is one reason why a "company pension plan" really has no place in a modern economy. From the employee's perspective, he'd be better off saving his own money and negotiating an employer match up front -- so he isn't tied to the employer for 30 years.
2. It's kind of funny how the type of incident you describe was far less common before laws prohibiting such things as sexual harassment were implemented, isn't it? There was a reason for this: any company that engaged in such activity even if it were perfectly legal would engender such revulsion in the marketplace that nobody would do business with them. Today, I would venture to guess that sexual harassment is far more of a problem in government -- where the employer doesn't have to worry about pissing off customers -- than in the private sector.
3. The third case is most interesting of all . . . if all companies based their hiring decisions on the political affiliations of their employees, then I am quite sure that within 18 months we'd have a private sector in which 95% of the companies are owned and staffed by Republicans. In fact, I would go so far as to suggest that in many industries, political affiliation is THE best indicator of an employee's value to the company.