They have the right to prevent anyone from boarding that doesn’t conform to their rules. I’m sure you could also be offloaded into any jurisdiction on the basis of ignoring crew orders if the mask was removed.
Any business could demand masks be worn on their premises. What the anti-maskers/libertarians fail to understand is others have rights as well.