It's a phrase borrowed from law enforcement and justice. Literally, it's the verdict: the accused has been found guilty on all charges (formal accusations of a crime) facing him. So if someone accuses me of anything, "charges" me metaphorically, and I admit that the accusation is correct, I can say "guilty as charged". Very often, however, people who say "guilty as charged" really mean "what difference does it make? so what? I'm still right!".