Mata Hari was probably just a beautiful Dutch girl in love with a German. Edith Clavell was British spy abusing the cover of the Red Cross. Mata Hari became a pergorative, while Clavell was lauded as a martyr. They were definitly both executed for spying.
Well, there is a chance Mata Hari was set up by the Germans. The message the French intercepted used a code the Germans already knew the French cracked. She may not have been a spy at all. Was she in love? Who knows, but she sounded like an adventuress. It’s true, the Brits at the time tried to portray Cavell as someone who was innocent, but I am not sure the real story is any less dramatic. Cavell did what she thought was her religious and patriotic duty. She knew she could eventually be executed for it. (By the way, the French executed several German nurses for the same thing. The Germans just didn’t want to publicize it.) I doubt Mata Hari knew her life might be at risk, whether she was spying or not.