It's called freedom of contract, which is a bedrock principle of law in any country with a thriving economy.
In this particular case this goes under unfair contractual terms, which is the way the law protects the small guy against the big guy who only has one contract and you either accept it or not. It is like a supermarket saying that we will not refund products of a very low quality. Your option is either to not buy anything in any supermarket, cus sure if it was legal they all would want to have that term in their contract, or buy and have no way of recourse.
"And the worst part about this all is that it states in the AdSense Terms of Service (TOS) that Google has the right to suspend any account without prior notification or explanation, and refund all of the earnings in that account to the respective advertisers."