It is unfair, and I don't see a whole lot of meaningful difference between "I fired her because she wouldn't sleep with me" and "I fired her because someone thought she might sleep with me".
There is all the difference in the world.
The first is coercion, and in some cases could be considered rape.
The second is avoiding a legally risky and morally inappropriate situation.
In this case all three layers of the courts agreed with the business owner. There have been many similar cases with the same result. Firing someone because of a risk of sexual relationships or jealousy is not protected by the law. Many people have been legally fired for that before, and many will be fired for it later.
The supreme court correctly pointed out that this firing is the opposite of discrimination, allowing it to continue could result in a lawsuit. Firing her is the least risky legal situation. The business owner did the right thing.
If the courts did say it was illegal to fire her then it means the business would be basically immune from sexual discrimination and harassment in the future. It would be a very easy case: "We tried to fix the situation before the harassment took place but the supreme court forced us not to, and here is the proof." All three courts realized just how insane that would have been.