When you are a double agent, you are NOT going to be appreciated by somebody, and probably not by anybody. What Mata Hari may have done is to give away some classified information to the Germans in the hope of gaining something of real importance for the French. She might not have let the French in on this idea, so when they saw that their agent was compromised by Mata Hari, they considered her to be a person of interest to counterintelligence, that is to say, a spy for the opposition.
When you say the French set her up, they probably did, to see if she was really on their side or not by giving her information that they could test her with. Double Agents must surely be a lot more common than most people believe, as both sides usually know who is going back and forth across the lines, and money, rather than patriotism is usually the primary motivation for spying. Suspicion must be the primary philosophy of all intelligence agencies because of the sensitivity of the information being stolen, so these agencies probably test all their agents in the way Mata Hari was tested, and she was tested, and "found wanting."