Hello Commander steve_muzz!
You've raised some interesting issues, so I thought I'd clarify a couple of points.
Who's in control of a system is a big thing in Elite: Dangerous. There are usually several minor factions vying for control, but outside the immediate local space around their starports and outposts, only one can claim to be "in control" of a system. This is displayed in the system view when you've no stellar body selected.
Normally it's the faction with the highest influence in the system, excepting special situations like civil war.
This is important for criminal law, because each faction only cares about crimes committed in its own jurisdiction. It doesn't matter if you are an infamous pirate according to say, the "Bangwa Freedom Party", if you are in the jurisdiction of the "Bagwa Independents" and you've committed no crimes against them, you are an innocent pilot.
In addition, most ships are aligned with a minor faction (you can see which one by performing a basic scan).
So if a ship is wanted in the current jurisdiction, but is aligned with a different minor faction for which it has no criminal record, then destroying it will cause you to lose reputation with the faction it is aligned with; in their opinion, you've just destroyed an innocent citizen of theirs.
Of course, you should gain reputation with the faction that you hand the bounty in to - they wanted the ship destroyed which is why they issued a bounty against it!
With regards to wings: if a ship is attacking you, they will be doing so either legally (you are wanted, possibly for attacking them without cause!), or illegally (if they're attacking you for piratical reasons for example). If they are attacking you illegally they will show up as "wanted" when scanned.
Therefore, in the case where the attack is illegal, as long as *someone* has scanned them to detect their wanted status, all wingmen can legally defend you with no legal repercussions (because scan results are shared among a wing).
On the other hand, if they are attacking you legally, that makes you the bad guy in the jurisdiction, and anyone helping you will also become a bad guy. This is why we display ships that are hostile to a wingman as purple - it lets individual Commanders decide whether they want to break the law to help their buddy.
The only times when no reputation loss should occur during bounty hunting is when the target is wanted in both the current jurisdiction and the jurisdiction of the minor faction it is aligned with (which can be the same thing but is not always).
With regards to shooting "innocent parties": ships that are not wanted in the current jurisdiction - you should be able to get away with a shot or two without triggering an offence, but if you rake such a vessel with sustained fire, hit it with large, high power weapons, or do damage to its hull, then you will have committed a crime.
I hope this helps explain how the crime system works a little. Of course, if the game at any point does not look like it's following these rules then a ticket should be created.