Think about it this way:
The money he walked away with (that he didn't start with) was the other guy's $20. The money he gave up to the other guy was $30. So he ended up losing $10. The other $20 was his money to begin with.
Looking at it from the other guy's perspective, he gave up $20 and is walking away with $30.