Hello! There are many posts about this very issue on the forums. What is most likely happening is that you are attacking a wanted ship that is aligned with the system's dominant faction (i.e. in Sol, Federal Congress currently), which is the faction of the local police. While you are justified in attacking the wanted ship (hence you do not yourself incur a bounty), you temporarily anger those who share that faction (the police, among others) and they will shoot you until you leave the instance. It's annoying and is most likely a bug, but for now, eyes up, commander. Be aware of your surroundings.
Target's faction is located in the left panel. Detailed info is found if you select his name. System faction information is located in the right panel. The factions listed will have a BLUE ARROW denoting your current location. Know these two factions so you can better decide which bounties to engage. That being said, do not automatically ignore those 7k Federal Congress bounties, just be prepared to make a tactical retreat to cash out and rearm.
Fly safely.