Some time ago I actually did think a bit about the difference between "nigga" and "nigger". Not so much the origin of the phonetic deviation, which would be redundant to touch on given the existing posts, but rather the actual connotative meaning that the word "nigga" itself can carry.
In the context of its being used, calling someone a nigga could either imply a sense of cordiality or endearment - ingroup usage - or otherwise imply a sense of otherness and contempt - outgroup usage. For instance, there is a stark contrast between these two sentences:
"Yeah, he's the nigga for real. That's my nigga right there!"
"This nigga's so retarded. Niggas really out here breaking into a free condom dispenser."
Not that this is something unique to the word, as there are many other words that likewise carry both positive and negative connotations based on their use. It's an important attribute to consider in this discussion, however, and the fact that it's rooted from a period of severe racial divide makes it stand out compared to words such as "pal", "motherfucker", and so on, which could substitute the word "nigga" in certain contexts.
The adoption of the word "nigga" into African American vernacular has been seen by some as a reclaiming of the word, shifting it from one of sheer contempt into one of an almost fraternal connection with each other, yet paradoxically it still remains as a means of distancing one's self from others, even in his own race. No clearer example of this could be made than Chris Rock's skit, "Niggas vs. Black People", which ripped straight into the critiques to be had on the culture pervading the black community at the time, and frankly still holds up today.
By this point, not only is the word "nigger" reviled solely for the racial hatred it brings with it, the word "nigga", considering its adoption by and for black people, coupled with the history of that which precedes it, has been expected to be used near exclusively by the same racial group. Despite the drastic difference in intent between a white person calling someone a nigger versus off-handedly throwing "nigga" into a sentence, it would still remain that this individual, being outside the race that has been deemed the right to use it, is still crossing a major taboo.
This still leaves the matter of the polarity between "nigga" in the fraternal vs. "nigga" in otherization, but I don't feel like spending any more time rambling on this shit than I already did