Our daughter intellectually understands our reasoning and accepted our decision without fuss. But of course she was disappointed and sad on the evening of the party.
This is a good outcome and probably the best you can hope for. It's perfectly okay and normal to be sad & disappointed, I would be too.
How can we help our children deal with situations where following the rules means that the are being “punished” for doing so while others are blatantly ignoring them and are being “rewarded” for their behavior?
By talking with her and NOT phrasing it as "reward" and "punishment". It's more about doing the "right" and the "wrong" thing. "Right" and "Wrong" here aare not absolute terms but it means behaving consistently with your own values and goals. There are always things you can do that feel tempting, but you don't do them sinesince it violates your own rules: anything from not driving drunk or lying to staying away from that yummy tub of ice cream in the freezer.
Let's look at your example. You can start with a "goal" discussion: let her think about how she would phrase goals & guidelines for Covid. You'll probably come up with something like this "Our: "Our goal for Covid is to stay healthy ourselves and not put other people at risk". If that's your goal, thanthen she did the "right" thinkthing by not going to the party.
Other people may behave differently perhaps because they either have other values or goals or they don't have the character or strength to stick to them. That's okay. We don't judge (unless it does harm to someone else). In this case, the other kids took significant risk for themselves but also to other people, so this is questionable behavior. This may have no consequences but it could also result in serious harm to an innocent person.
The niece of a friend of ours went to an outdoor bar and got Covid. Now her entire family has it and her father is in the hospital fighting for his life.
Sticking to your own goals and values is the best way to go through life. It's not always easy and not always pleasant and things will still go wrong occasionally, but it will result in much more long term happiness.