Facebook has won $873 million in a legal battle against a spammer.