What is hard to understand in "system stability increases, economy goes boom, reputation rises" ?
You helped a "hidden conflict" between two local factions.
Empire does not like conflict.
Rep propagates down and upwards, and from up downwards.
In the end the rep feedback even to the local faction was more negative than positive as you won local rep, and then local rep from empire down to local patron. Overall the result was negative.
That's what galactic factions like the most, stability.
Federation is actually more lenient towards local disputes. You can work with one against the other and many times overall Feds just don't care most of the time.
Empire is more intricate.
Test it out and you will see what I mean.
On the other hand if you get caught with illegal cargo or get bounties and similar the Fed rep drops much more than the Empire one.
I have no idea about Alliance. Can't be bother at the moment with my home system having a civil war between republicans and crimsons
Good luck.