Because it was part of a contract they entered into with their employees. A contract they sought to change afterwards based on a sham of religious beliefs.
But it was really because a Black man became President and got universal healthcare insurance coverage passed.
They are not ruling on the immorality of abortion, they are ruling that it is not defined in the constitution as a right and it is up to the states to decide.