OP I'm sorry you are getting a hard time here, but you realise this is not about leggings at all. If she is very attractive it doesn't matter what she wears your husband is going to notice, that's just human nature. If she's been with you for 2 years and it's only bothering you now it's probably because you don't feel your best.
Truthfully the leggings are fine for a cleaning job, she needs to be comfortable stretching and bending. If she was wearing a mini skirt I would agree with you. But also, if she was older, unattractive and out of shape would it bother you if she was wearing those leggings? Probably not.
It's probably uncomfortable for her also to be cleaning when you are both there, is there a way for her to clean when you are out of the house or something? It's a bit weird for her to clean your husband's office while he is working in there, surely he could vacate for a few minutes while she cleans?
I had a part time cleaning job a years ago (in a tennis club, not in someones home so a bit different) but I hated having to 'clean around' people, it was very awkward. So I used to come in early when nobody was there, so much easier. Maybe you could try heading out for a walk while she cleans to give her some space.
Overall, I don't really know what the answer is, but I don't think you are being horrible, maybe a bit unreasonable, but unfortunately insecurity can make us irrational at times.
Or maybe you could hire a really hot male gardener for the summer so you have someone nice to look at and see how your husband likes it 😁