Sure, it has an effect on profit, but nowhere near enough of an effect to justify mistreating their workers in such a way. One big thing to keep in mind when talking about company profits is that when they say a policy would make them "lose money," what they're actually saying is, "we won't be able to make *as much*" if the policy's enacted.
That's what's going on when corporations bitch and moan about paying their workers a fair share. They're upset because their CEOs might only be able to make 5 million a year now instead of the 10 million they wanted.