It's cause there's a unwritten understanding that the restaurant has underpriced the menu by about 15-20% with the expectation that you'll pay an appropriate tip. Not giving an appropriate tip when it's warranted is in the same ballpark as seeking other unethical (though legal) discounts.