By optimizing ad revenues, you are increasing the number of people who find a product which they find valuable. This is useful - some people are better off than they would be otherwise.
A significant portion of HFT is simply about winning a race. The first to trade gets the benefits. Doing a better job of HFT merely redistributes the benefits of trade rather than creating them.
(Of course, there are other more useful aspects of HFT. Providing liquidity where none existed before is useful, and providing a better bid when you lost the race (i.e., if you lost the race to bid $10.01 first, you can win the race by bidding $10.02) is also useful. But I don't think the criticism of wasted effort is off the mark.)