Maybe it's too late at night but I can't see what's wrong with that.

You killed pirates from the target faction, which reduced their influence in the system where you killed them (killing any of their members, clean or wanted, will do that) and incidentally boosted their economy (pirates attacking traders is not good for business).
As a result you gained Reputation with the mission-giving faction in the system where you took the mission, boosted their influence and improved their economy also.
Could you add a little more about what you expected to happen?