Not all black hat SEO is legal - but in any event, if google catches you, it can just ban your domain.
No law against "black hat" but scrapping content from other sites can be copyright infringement - which can be criminal. Black hat is a broad term that includes many different techniques. All the ad shows is that google lets you advertise the keyword.
There's more than one Black Hat method; are we talking about link spamming? text scraping? setting up spam blogs? etc. Each method has to be evaluated individually.