In the case of Ghouls, I definitely think of it as a Karma bonus for killing something that is agony.
As for Caesar's Legion and Powder Gangers, they are evil, so killing them gives you good Karma. They are evil in different ways tho.
The Poweder Gangers are mainly evil because they are hostile to EVERYONE no matter what, unless (I guess) you side with them destroying the first town. But that is unjustified, and again, they are basically all hostile to everyone around them. You pretty much have to kill them as a menace because they are aggressive. I think the ones in the vault with their leader are an exception, but they seem non-hostile there only for quest reasons ... and well, maybe in their home they are more relaxed.

The Legion arent immediately hostile because they are open to recruiting. In fact they actively recruit. But they are evil because of their methods ([censored], slavery, using women as cattle, crucifixion). Killing them is all good karma, all the time.
The other groups are a mixed bag. You can point to abuse of power by leaders or selfish motivations or the all-encompassing grind of bureaucracy and/or annexation, but ultimately they (NCR, Brotherhood of Steel, Kings, other groups) are simply human with all the mixed bag of both good and evil. But these groups aren't inherently evil or good, and a lot of the rank-and-file people are pretty decent regular folks.
So basically the morality in the game is pretty simple. You can agree or disagree, but in their universe, there it is. Killing obviously hostile/evil groups is good. Killing mindless humans (ghouls) in pain is good. Stealing is wrong, even from enemy factions, because you are stealing claimed items, but taking items off someone who was a foe is acceptable. Pretty black and white. And yet there are still lots of nice shades of grey in the game too. Its a good balance.